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]

extra symtab entries in thumb mode


Hello,

While trying to get NetBSD userspace running in thumb mode on ARM, I had
to upgrade binutils from NetBSD's 2.16.1 to the at the time latest snapshot 
2.18.50. 

This fixed the plt section interworking issues with thumb and ARM mode code,
but resulted in thumb mode shared objects file size being bigger than the
corresponding ARM ones due to larger symtab and strtab sections. The
build infrastructure are the same for ARM and thumb builds, except for
CPUFLAGS variable, so I'm guessing this is a binutils bug or feature.

I went through the changelog changes between 2.18.50 and 2.19.50 but
didn't find anything related to my problem.

Is this a known feature/bug and perhaps fixed in some newer than 2.18.50
version of binutils?

And is there some known workaround for this?

Here are some ARM and thumb mode comparisons of NetBSD libc:

file size, thumb mode: 1223009

file size, ARM mode:   1128708

size, thumb mode:

   text    data     bss     dec     hex filename
 727443   26160   65680  819283   c8053 obj-thumb/destdir.evbarm/lib/libc.so.12.163

size, ARM mode:

   text    data     bss     dec     hex filename
 935375   26160   65680 1027215   fac8f obj-arm/destdir.evbarm/lib/libc.so.12.163

readelf -S|grep tab , thumb mode:

  [109] .shstrtab         STRTAB          00000000 0c8ea7 00087b 00 0   0  1
  [110] .symtab           SYMTAB          00000000 0ca8a4 03c0d0 10 111 12233  4
                                                          ^^^^^^
  [111] .strtab           STRTAB          00000000 106974 023fed 00 0   0  1
                                                          ^^^^^^
readelf -S|grep tab , ARM mode:

  [109] .shstrtab         STRTAB          00000000 0fbae3 00087b 00 0   0  1
  [110] .symtab           SYMTAB          00000000 0fd4e0 00cbe0 10 111 122  4
                                                          ^^^^^^
  [111] .strtab           STRTAB          00000000 10a0c0 009844 00 0   0  1
                                                          ^^^^^^
readelf -a|grep ^Symbol , thumb mode:

Symbol table '.dynsym' contains 3143 entries:
Symbol table '.symtab' contains 15373 entries:
                                ^^^^^
readelf -a|grep ^Symbol , ARM mode:

Symbol table '.dynsym' contains 3143 entries:
Symbol table '.symtab' contains 3262 entries:
                                ^^^^

A view at the symtab symbol table shows that in thumb mode it contains
a few thousand more functions beginning with leading underscores and 
around seven thousand of NOTYPE's named $a, $d and $t. Starting from
thumb mode entry 12233 the names are equal to ARM mode entries starting
from 122.

Any ideas for fixing this are appreciated.

-Mikko


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