This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

redundant entry in .dynsym with gnu hash + version script


Hi,

There seems to be a redundant entry in .dynsym, when ld is used with
gnu hash and version script. It appears on ARM architecture, but could
not observed in powerpc and i386 architecuture, but I don't think this
is architecture specific.

I couldn't find similar case to this, if it is a known issue, please
forgive me.

The version I'm using is:

$ arm-unknown-linux-gnueabi-ld --version
GNU ld (Linux/GNU Binutils) 2.17.50.0.15.20070418


Here is how to reproduce:

$ cat foo.c 
void foo(void) {}

$ cat bar.c
extern void foo(void);
void bar(void) { foo(); }

$ cat ver.map 
TEST_1.0 {
        global:
        *;
};

$ arm-unknown-linux-gnueabi-gcc -O2 -g -shared -o libfoo.so foo.c -Wl,--version-script,ver.map
$ arm-unknown-linux-gnueabi-gcc -O2 -g -shared -L. -lfoo -Wl,--hash-style,gnu -o libbar.so bar.c

$ arm-unknown-linux-gnueabi-readelf -s libbar.so

Symbol table '.dynsym' contains 19 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000036c     0 SECTION LOCAL  DEFAULT    8 
     2: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
     3: 00000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
     4: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND foo
     5: 00000000   328 FUNC    WEAK   DEFAULT  UND __cxa_finalize@GLIBC_2.4 (2)
     6: 00000480     4 FUNC    GLOBAL DEFAULT   10 bar
     7: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     8: 00000494     0 NOTYPE  GLOBAL DEFAULT  ABS __exidx_end
     9: 000085b4     0 NOTYPE  GLOBAL DEFAULT  ABS _bss_end__
    10: 000085b4     0 NOTYPE  GLOBAL DEFAULT  ABS _end
    11: 000085b0     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
    12: 000085b4     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_end__
    13: 000085b0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    14: 0000036c     0 FUNC    GLOBAL DEFAULT    8 _init
    15: 00000484     0 FUNC    GLOBAL DEFAULT   11 _fini
    16: 000085b0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start__
    17: 000085b4     0 NOTYPE  GLOBAL DEFAULT  ABS __end__
    18: 00000494     0 NOTYPE  GLOBAL DEFAULT  ABS __exidx_start
...


Entry No 7 with NOTYPE/LOCAL/DEFAULT/UND seems to be redundant.

It seems harmless for this sample, but when I compiled openssl-0.9.8g
with the same toolchain, there was a corrupt entry like this:


$ arm-unknown-linux-gnueabi-readelf -s usr/lib/ssl/engines/libchil.so

Symbol table '.dynsym' contains 87 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
...
    71: 00000000   328 FUNC    WEAK   DEFAULT  UND __cxa_finalize@GLIBC_2.4 (4)
    72: e24dd004 0xa00002e <OS specific>: 12 WEAK   DEFAULT [<other>: 24]  58783
 <corrupt>
    73: 000038f4     0 NOTYPE  GLOBAL DEFAULT  ABS __exidx_end@@OPENSSL_0.9.8


entry 72 does not seem good. dump of .dynsym is
Hex dump of section '.dynsym':
  0x000000fc 00000000 00000000 00000000 00000000 ................
...
  0x0000056c 1c000000 00000000 48010000 22000000 ........H..."...
  0x0000057c 000050e3 04d04de2 2e00000a 2c249fe5 ..P...M.....,$..
  0x0000058c 7c050000 f4380000 00000000 1000f1ff |....8..........

and entry data in 0x57c does not look good.

Any hint for this problem is appreciated.


Best Regards,

(Hiroki Kaminaga)
t
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]