bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/4701] Linker fails to adjust segment offset with .bss sections


From: hjl at lucon dot org
Subject: [Bug ld/4701] Linker fails to adjust segment offset with .bss sections
Date: 28 Jun 2007 02:37:11 -0000

------- Additional Comments From hjl at lucon dot org  2007-06-28 02:37 -------
Created an attachment (id=1903)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1903&action=view)
A testcase

I got

bash-3.1$ make
gcc -m32    -c -o x.o x.c
gcc -m32    -c -o bss.o bss.c
./ld  -m elf_i386 -T bss.t -shared -o libbss.so bss.o
gcc -m32 -Wl,-z,nocopyreloc,-R,. -o x x.o libbss.so
./x
./x: error while loading shared libraries: libbss.so: ELF load command
address/offset not properly aligned
make: *** [all] Error 127
bash-3.1$ readelf -Sl libbss.so
There are 10 section headers, starting at offset 0x19c:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .hash             HASH            000000b4 0000b4 000014 04   A  2   0 
4
  [ 2] .dynsym           DYNSYM          000000c8 0000c8 000020 10   A  3   1 
4
  [ 3] .dynstr           STRTAB          000000e8 0000e8 000005 00   A  0   0 
1
  [ 4] .dynamic          DYNAMIC         000000f0 0000f0 000058 08  WA  3   0 
4
  [ 5] .got.plt          PROGBITS        00000148 000148 00000c 04  WA  0   0 
4
  [ 6] .bss              NOBITS          00010000 000154 000004 00  WA  0   0 
4
  [ 7] .shstrtab         STRTAB          00000000 000154 000048 00      0   0 
1
  [ 8] .symtab           SYMTAB          00000000 00032c 0000b0 10      9  10 
4
  [ 9] .strtab           STRTAB          00000000 0003dc 00002a 00      0   0 
1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Elf file type is DYN (Shared object file)
Entry point 0xf0
There are 4 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x00154 0x00154 RW  0x1000
  LOAD           0x000154 0x00010000 0x00010000 0x00000 0x00004 RW  0x1000
  DYNAMIC        0x0000f0 0x000000f0 0x000000f0 0x00058 0x00058 RW  0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .dynamic .got.plt 
   01     .bss 
   02     .dynamic 
   03     
bash-3.1$ 


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4701

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]