Skip to contentSkip to conversation

u-boot/mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

PATCH Superseded Prabhakar Kushwaha 3 participants 3 messages Oct 25, 2015 – Nov 3, 2015 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 u-boot/mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

From: Zhenhua Luo <[email protected]>

In binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbols defined by PROVIDE in u-boot.lds overrides the linker built-in symbols
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=b893397a4b1316610f49819344817715e4305de9),
so the linker is treating _GLOBAL_OFFSET_TABLE_ as a definition into the .reloc section.

To align with the change of binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbol should not be defined in sections, and the symbols in linker generated .got section should be used(https://sourceware.org/ml/binutils/2008-09/msg00122.html).

Fixed the following build errors with binutils-2.25:
| powerpc-poky-linux-gnuspe-ld.bfd: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got

---
 arch/powerpc/cpu/mpc85xx/u-boot-nand.lds     | 1 -
 arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 1 -
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds      | 1 -
 arch/powerpc/cpu/mpc85xx/u-boot.lds          | 1 -
 4 files changed, 4 deletions(-)
arch/powerpc/cpu/mpc85xx/u-boot-nand.lds +0 -1
index f933b21..0399f93 100644
@@ -44,7 +44,6 @@ SECTIONS
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
     KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds +0 -1
index b83c553..f044564 100644
@@ -22,7 +22,6 @@ SECTIONS
 		_GOT2_TABLE_ = .;
 		KEEP(*(.got2))
 		KEEP(*(.got))
-		PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
 		_FIXUP_TABLE_ = .;
 		KEEP(*(.fixup))
 	}
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +0 -1
index 5ae7b3e..889a4c2 100644
@@ -29,7 +29,6 @@ SECTIONS
 		_GOT2_TABLE_ = .;
 		KEEP(*(.got2))
 		KEEP(*(.got))
-		PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
 		_FIXUP_TABLE_ = .;
 		KEEP(*(.fixup))
 	}
arch/powerpc/cpu/mpc85xx/u-boot.lds +0 -1
index 2cf0b25..f15eaf3 100644
@@ -50,7 +50,6 @@ SECTIONS
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
     KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 u-boot/mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

Quoted 11 lines · Prabhakar Kushwaha

From: Zhenhua Luo <[email protected]>

In binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbols defined by PROVIDE in u-boot.lds overrides the linker built-in symbols
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=b893397a4b1316610f49819344817715e4305de9),
so the linker is treating _GLOBAL_OFFSET_TABLE_ as a definition into the .reloc section.

To align with the change of binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbol should not be defined in sections, and the symbols in linker generated .got section should be used(https://sourceware.org/ml/binutils/2008-09/msg00122.html).

Quoted 5 lines

Fixed the following build errors with binutils-2.25:
| powerpc-poky-linux-gnuspe-ld.bfd: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got

What happens when we use older binutils? I'd like some run-time testing too please :) Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151025/074b488b/attachment.sig>
#2 lore raw

PATCH 1/1 u-boot/mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

Hi Tom,

Quoted 25 lines

-----Original Message-----
From: Tom Rini [mailto:trini at konsulko.com]
Sent: Sunday, October 25, 2015 9:46 PM
To: Kushwaha Prabhakar-B32579 <[email protected]>
Cc: u-boot at lists.denx.de; Sun York-R58495 <[email protected]>; Luo Zhenhua-B19537 <[email protected]>
Subject: Re: [U-Boot] [PATCH] u-boot/mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

Quoted 7 lines · Prabhakar Kushwaha

From: Zhenhua Luo <[email protected]>

In binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbols defined by PROVIDE in u-boot.lds overrides the linker built-in symbols
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff
;h=b893397a4b1316610f49819344817715e4305de9),
so the linker is treating _GLOBAL_OFFSET_TABLE_ as a definition into

the .reloc section.

Quoted 4 lines

To align with the change of binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbol should not be defined in sections, and the symbols in linker generated .got section should be

used(https://sourceware.org/ml/binutils/2008-09/msg00122.html).

Quoted 1 line
Quoted 8 lines
Quoted 6 lines

Fixed the following build errors with binutils-2.25:
| powerpc-poky-linux-gnuspe-ld.bfd: _GLOBAL_OFFSET_TABLE_ not defined | in linker created .got

What happens when we use older binutils?

[Luo Zhenhua-B19537] I verified the u-boot build for p4080ds(e500v2) with binutils-2.23.2, the build passed.

I'd like some run-time testing too please :) Thanks!
[Luo Zhenhua-B19537] I did sanity test for the u-boot on p4080ds, it works normally.

The log files are attached.

Best Regards,

Zhenhua

Quoted 1 line

Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot.log
Type: application/octet-stream
Size: 6686 bytes
Desc: u-boot.log
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151103/c66c6374/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot-build.log
Type: application/octet-stream
Size: 15547 bytes
Desc: u-boot-build.log
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151103/c66c6374/attachment-0001.obj>