[PATCH][RFC] Explicitly set ELF symbol size to zero for undefined symbols -- libbfd, gold
Alan Modra
amodra@bigpond.net.au
Tue Jul 22 14:17:00 GMT 2008
On Mon, Jul 21, 2008 at 10:02:03PM -0700, Chris Demetriou wrote:
> On Mon, Jul 21, 2008 at 19:49, Alan Modra <amodra@bigpond.net.au> wrote:
> > * elflink.c (elf_link_output_extsym): Set st_size to zero for
> > symbols from dynamic libraries.
Fix some fallout from the above.
* ld-alpha/tlsbin.rd: Update.
* ld-alpha/tlsbinr.rd: Update.
* ld-arm/mixed-app.sym: Update.
* ld-arm/use-thumb-lib.sym: Update.
* ld-cris/pv32-1.d: Update.
Index: ld/testsuite/ld-alpha/tlsbin.rd
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-alpha/tlsbin.rd,v
retrieving revision 1.9
diff -u -p -r1.9 tlsbin.rd
--- ld/testsuite/ld-alpha/tlsbin.rd 30 Sep 2007 01:33:14 -0000 1.9
+++ ld/testsuite/ld-alpha/tlsbin.rd 22 Jul 2008 13:00:50 -0000
@@ -58,7 +58,7 @@ Symbol table '\.dynsym' contains [0-9]+
+Num: +Value +Size Type +Bind +Vis +Ndx Name
[0-9 ]+: [0-9a-f]+ +0 NOTYPE +LOCAL +DEFAULT +UND *
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
-[0-9 ]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+[0-9 ]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
[0-9 ]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
[0-9 ]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
@@ -109,7 +109,7 @@ Symbol table '\.symtab' contains [0-9]+
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
-[0-9 ]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+[0-9 ]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
Index: ld/testsuite/ld-alpha/tlsbinr.rd
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-alpha/tlsbinr.rd,v
retrieving revision 1.10
diff -u -p -r1.10 tlsbinr.rd
--- ld/testsuite/ld-alpha/tlsbinr.rd 30 Sep 2007 01:33:14 -0000 1.10
+++ ld/testsuite/ld-alpha/tlsbinr.rd 22 Jul 2008 13:00:50 -0000
@@ -53,7 +53,7 @@ Symbol table '\.dynsym' contains [0-9]+
+Num: +Value +Size Type +Bind +Vis +Ndx Name
[0-9 ]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND
[0-9 ]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
-[0-9 ]+: 0+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+[0-9 ]+: 0+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
[0-9 ]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
[0-9 ]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
[0-9 ]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
@@ -104,7 +104,7 @@ Symbol table '\.symtab' contains [0-9]+
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
-[0-9 ]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+[0-9 ]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
[0-9 ]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
Index: ld/testsuite/ld-arm/mixed-app.sym
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/mixed-app.sym,v
retrieving revision 1.5
diff -u -p -r1.5 mixed-app.sym
--- ld/testsuite/ld-arm/mixed-app.sym 13 Nov 2006 21:18:36 -0000 1.5
+++ ld/testsuite/ld-arm/mixed-app.sym 22 Jul 2008 13:00:50 -0000
@@ -6,12 +6,12 @@ Symbol table for image:
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _end
.. ..: ........ 4 OBJECT GLOBAL DEFAULT 12 data_obj
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_end__
- .. ..: 0*[^0]*.* 20 FUNC GLOBAL DEFAULT UND lib_func1
+ .. ..: 0*[^0]*.* 0 FUNC GLOBAL DEFAULT UND lib_func1
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT 11 __data_start
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __end__
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
.. ..: .......0 0 FUNC GLOBAL DEFAULT 8 app_func2
- .. ..: 0*[^0]*.* 2 FUNC GLOBAL DEFAULT UND lib_func2
+ .. ..: 0*[^0]*.* 0 FUNC GLOBAL DEFAULT UND lib_func2
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _bss_end__
.. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __exidx_end
Index: ld/testsuite/ld-arm/use-thumb-lib.sym
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/use-thumb-lib.sym,v
retrieving revision 1.4
diff -u -p -r1.4 use-thumb-lib.sym
--- ld/testsuite/ld-arm/use-thumb-lib.sym 2 Oct 2006 17:10:56 -0000 1.4
+++ ld/testsuite/ld-arm/use-thumb-lib.sym 22 Jul 2008 13:00:50 -0000
@@ -1,4 +1,4 @@
#...
- .. ..: 00000000 2 FUNC GLOBAL DEFAULT UND lib_func2
+ .. ..: 00000000 0 FUNC GLOBAL DEFAULT UND lib_func2
#pass
Index: ld/testsuite/ld-cris/pv32-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/pv32-1.d,v
retrieving revision 1.5
diff -u -p -r1.5 pv32-1.d
--- ld/testsuite/ld-cris/pv32-1.d 15 Aug 2005 15:39:45 -0000 1.5
+++ ld/testsuite/ld-cris/pv32-1.d 22 Jul 2008 13:00:50 -0000
@@ -8,10 +8,10 @@
.*: file format elf32-cris
DYNAMIC SYMBOL TABLE:
-0+8021e DF \*UND\* 0+2 expfn
+0+8021e DF \*UND\* 0+ expfn
0+82324 g DO \.bss 0+4 expobj
0+82324 g D \*ABS\* 0+ __bss_start
-0+80238 DF \*UND\* 0+8 dsofn3
+0+80238 DF \*UND\* 0+ dsofn3
0+82324 g D \*ABS\* 0+ _edata
0+82340 g D \*ABS\* 0+ _end
0+80264 g DF \.text 0+8 dsofn
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list