https://sourceware.org/bugzilla/show_bug.cgi?id=33722

            Bug ID: 33722
           Summary: aarch64 ld mentions .data and .init as local symbols
                    in .dynsym
           Product: binutils
           Version: 2.44
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: amonakov at gmail dot com
  Target Milestone: ---
            Target: aarch64-*-*

echo 'int i;' > t.c

gcc -shared -o t.so t.c

readelf --dyn-sym t.so

Symbol table '.dynsym' contains 8 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000408     0 SECTION LOCAL  DEFAULT    7 .init
     2: 0000000000020010     0 SECTION LOCAL  DEFAULT   18 .data
     3: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_finalize
     4: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND
_ITM_registerTMC[...]
     5: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND
_ITM_deregisterT[...]
     6: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
     7: 000000000002001c     4 OBJECT  GLOBAL DEFAULT   19 i

Note how .init and .data are mentioned in dynamic symbol table for no apparent
reason. Other linkers do not produce them, and on other targets (x86, ppc) this
is not observed either (although crti.o and other files are be different
there).

For a reduced example, linking crti.o alone is sufficient:

ld -shared -o t.so /usr/lib/aarch64-linux-gnu/crti.o

readelf --dyn-sym t.so

Symbol table '.dynsym' contains 3 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000270     0 SECTION LOCAL  DEFAULT    6 .init
     2: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to