[uClibc].note.ABI-tag sections?

Ray L rayl at mail.com
Tue Jan 28 16:40:55 UTC 2003


On Tue, Jan 28, 2003 at 01:29:25AM -0700, Erik Andersen wrote:
> On Mon Jan 27, 2003 at 09:41:57PM -0700, Ray L wrote:
>
> > how do i get arm-uclibc-gcc to insert a .note.ABI-tag section in my executables
> > so that gdb can debug them properly?
> 
> This is added to uClibc via uClibc/libc/misc/internals/abi-note.S

yes, the section appears in libuClibc-0.9.17.so, but not in my executables.



> Hmm.  Is your app linked staticly?  I suppose it is possible the
> symbol isn't being included when staticly linking.

nope, they are dynamic executables.

i'll use /usr/bin/wget as an example.  eel is my desktop, target is my arm720
board.



==========================================================================

why does ldd show all zeros for the load addresses?

rayl at eel:~/proj/buildroot2> arm-uclibc-ldd build/root/usr/bin/wget
        libc.so.0 => /home/rayl/proj/buildroot2/build/staging_dir/lib/libc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)

target:/tmp # ldd /usr/bin/wget
        libc.so.0 => /lib/libc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)



==========================================================================

where is the .note.ABI-tag section created?  i do not see anything in any
ldscript or spec file which creates a .note.ABI-tag output section in
normal executables or shared objects...  (unless i'm misunderstanding
how ldscripts work, which is a distinct possibility :-)



rayl at eel:~/proj/buildroot2> arm-uclibc-objdump -h build/root/usr/bin/wget

build/root/usr/bin/wget:     file format
elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .interp       00000014  000080d4  000080d4  000000d4  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .hash         00000870  000080e8  000080e8  000000e8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynsym       00001130  00008958  00008958  00000958  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .dynstr       0000082a  00009a88  00009a88  00001a88  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rel.dyn      00000058  0000a2b4  0000a2b4  000022b4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .rel.plt      000007c8  0000a30c  0000a30c  0000230c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .init         00000018  0000aad4  0000aad4  00002ad4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .plt          00000fa0  0000aaec  0000aaec  00002aec  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  8 .text         0003c6cc  0000ba8c  0000ba8c  00003a8c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  9 .fini         00000014  00048158  00048158  00040158  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .rodata       0000df60  0004816c  0004816c  0004016c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .data         0000089c  0005e0cc  0005e0cc  0004e0cc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 12 .eh_frame     00000004  0005e968  0005e968  0004e968  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 13 .dynamic      000000b0  0005e96c  0005e96c  0004e96c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 14 .ctors        00000008  0005ea1c  0005ea1c  0004ea1c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 15 .dtors        00000008  0005ea24  0005ea24  0004ea24  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 16 .jcr          00000004  0005ea2c  0005ea2c  0004ea2c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 17 .got          000003f4  0005ea30  0005ea30  0004ea30  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .sbss         00000000  0005ee24  0005ee24  0004ee40  2**0
                  CONTENTS
 19 .bss          00007044  0005ee40  0005ee40  0004ee40  2**5
                  ALLOC


==========================================================================

the .note.ABI-tag section DOES appear in the libc shared object.

i'm assuming the --whole-archive flag in build/uClibc/libc/Makefile
forces the inclusion of the .note.ABI-tag section from abi-note.o into
libuClibc-0.9.17.so, correct?


rayl at eel:~/proj/buildroot2> arm-uclibc-objdump -h build/root/lib/libuClibc-0.9.17.so

build/root/lib/libuClibc-0.9.17.so:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .hash         000024a8  000000f4  000000f4  000000f4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .dynsym       00005210  0000259c  0000259c  0000259c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynstr       00003295  000077ac  000077ac  000077ac  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rel.dyn      00001a28  0000aa44  0000aa44  0000aa44  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rel.plt      00001030  0000c46c  0000c46c  0000c46c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .plt          00002070  0000d49c  0000d49c  0000d49c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .text         0005c16c  0000f510  0000f510  0000f510  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .rodata       000039c0  0006b67c  0006b67c  0006b67c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .note.ABI-tag 00000020  0006f040  0006f040  0006f040  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .interp       00000014  0006f060  0006f060  0006f060  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .data         00000b60  00077074  00077074  0006f074  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 11 .dynamic      000000a8  00077bd4  00077bd4  0006fbd4  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 12 .got          00000fd0  00077c7c  00077c7c  0006fc7c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 13 .sbss         00000000  00078c4c  00078c4c  00070c60  2**0
                  CONTENTS
 14 .bss          00002b24  00078c60  00078c60  00070c60  2**5
                  ALLOC
 15 .gnu.warning.setlocale 00000038  00000000  00000000  00070c60  2**2
                  CONTENTS, READONLY
 16 .gnu.warning.localeconv 00000040  00000000  00000000  00070c98  2**2
                  CONTENTS, READONLY
 17 .gnu.warning.gets 0000003c  00000000  00000000  00070cd8  2**2
                  CONTENTS, READONLY
 18 .gnu.warning.__fpending 000000a8  00000000  00000000  00070d14  2**2
                  CONTENTS, READONLY
 19 .gnu.warning._sys_errlist 00000098  00000000  00000000  00070dbc  2**2
                  CONTENTS, READONLY



==========================================================================

here is the ldso trace with debugging enabled.  everything works as expected.


target:/tmp # wget http://eel/~rayl/README
ELF header=0x40000000
First Dynamic section entry=0x400113c8
About to do library loader relocations.
About to fixup symbol: _dl_linux_resolver
About to fixup symbol: _dl_progname
About to fixup symbol: _dl_linux_resolve
About to fixup symbol: _dl_preload
About to fixup symbol: _dl_library_path
About to fixup symbol: _dl_ldsopath
About to fixup symbol: _dl_brkp
About to fixup symbol: _dl_envp
About to fixup symbol: _dl_loaded_modules
About to fixup symbol: _dl_debug_state
About to fixup symbol: _dl_debug_addr
About to fixup symbol: _dl_symbol_tables
About to fixup symbol: _dl_handles
About to fixup symbol: _dl_internal_error_number
About to fixup symbol: _dl_error_number
About to fixup symbol: _dl_malloc_function
About to fixup symbol: _dl_load_shared_library
About to fixup symbol: _dl_unsetenv
About to fixup symbol: _dl_copy_fixups
About to fixup symbol: _dl_parse_relocation_information
About to fixup symbol: _dl_find_hash
About to fixup symbol: _dl_elf_hash
About to fixup symbol: _dl_malloc
About to fixup symbol: _dl_load_elf_shared_library
About to fixup symbol: _dl_parse_copy_information
About to fixup symbol: _dl_check_hashed_files
About to fixup symbol: _dl_fixup
About to fixup symbol: _dl_dprintf
About to fixup symbol: _dl_parse_lazy_relocation_information
About to fixup symbol: _dl_strdup
About to fixup symbol: _dl_add_elf_hash_table
About to fixup symbol: _dl_getenv
Done relocating library loader, so we can now
        use globals and make function calls!
GOT found at 0x40011468
Lib Loader:     (0x40000000) /lib/ld-uClibc.so.0
Loading:        (0x40012000) /lib/libc.so.0
Beginning relocation fixups
Beginning copy fixups
README  100% |*****************************| 99827       00:00 ETA






==========================================================================

when running under gdb, however, it dies.  

according to http://sources.redhat.com/ml/gdb/2002-07/msg00115.html, gdb
is inserting arm-elf breakpoints instead of arm-linux breakpoints.


target:/tmp # gdb /usr/bin/wget

GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "arm-linux"...(no debugging symbols found)...
(gdb) run http://eel/~rayl/README
Starting program: /usr/bin/wget http://eel/~rayl/README
wget (293): undefined instruction: pc=400037e0
Code: e5933010 e50b303c eaffffbc e91bac10 (e7ffdefe)
wget (293): undefined instruction: pc=400037e4
Code: e50b303c eaffffbc e91bac10 e1a0c00d (e7ffdefe)
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGILL, Illegal instruction.
0x400037e4 in _dl_debug_state () from /lib/ld-uClibc.so.0
(gdb)





-- 
---------------------------------------------------------------------------
    Ray L <rayl at mail.com>



More information about the uClibc mailing list