diff mbox

[1/5] arm64: Fix __data_loc value

Message ID 35a937043d1b3eae1b1ea547efc25f75b5f43f67.1386879684.git.geoff@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Geoff Levand Dec. 12, 2013, 8:39 p.m. UTC
The __data_loc variable should be set to the VMA of the data section, not
the LMA.

At present LOAD_OFFSET is not set and defaults to zero, so this bug
does not cause any problems.

Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
 arch/arm64/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Russell King - ARM Linux Dec. 13, 2013, 5:46 p.m. UTC | #1
On Thu, Dec 12, 2013 at 08:39:45PM +0000, Geoff Levand wrote:
> The __data_loc variable should be set to the VMA of the data section, not
> the LMA.
> 
> At present LOAD_OFFSET is not set and defaults to zero, so this bug
> does not cause any problems.

Why does ARM64 have this in the first place?  __data_loc is used for
XIP support on ARM, does ARM64 have XIP support?
Catalin Marinas Dec. 13, 2013, 6:17 p.m. UTC | #2
On Fri, Dec 13, 2013 at 05:46:47PM +0000, Russell King - ARM Linux wrote:
> On Thu, Dec 12, 2013 at 08:39:45PM +0000, Geoff Levand wrote:
> > The __data_loc variable should be set to the VMA of the data section, not
> > the LMA.
> > 
> > At present LOAD_OFFSET is not set and defaults to zero, so this bug
> > does not cause any problems.
> 
> Why does ARM64 have this in the first place?  __data_loc is used for
> XIP support on ARM, does ARM64 have XIP support?

Not a good reason, copy-paste leftover.
Geoff Levand Dec. 14, 2013, 12:20 a.m. UTC | #3
Hi Catalin,

On Fri, 2013-12-13 at 18:17 +0000, Catalin Marinas wrote:
> On Fri, Dec 13, 2013 at 05:46:47PM +0000, Russell King - ARM Linux wrote:
> > On Thu, Dec 12, 2013 at 08:39:45PM +0000, Geoff Levand wrote:
> > > The __data_loc variable should be set to the VMA of the data section, not
> > > the LMA.
> > > 
> > > At present LOAD_OFFSET is not set and defaults to zero, so this bug
> > > does not cause any problems.
> > 
> > Why does ARM64 have this in the first place?  __data_loc is used for
> > XIP support on ARM, does ARM64 have XIP support?
> 
> Not a good reason, copy-paste leftover.

I didn't check how __data_loc was used.  I assumed it was of some use
and just did what was needed to suppress a link error in my work.

I'll post a patch that removes it.

-Geoff
diff mbox

Patch

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 5161ad9..3072c41 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -99,7 +99,7 @@  SECTIONS
 
 	. = ALIGN(PAGE_SIZE);
 	_data = .;
-	__data_loc = _data - LOAD_OFFSET;
+	__data_loc = _data;
 	_sdata = .;
 	RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
 	_edata = .;