SPECS: binutils.spec - cosmetics (by sebastian at oclab.ano.pl)
Jakub Bogusz
qboosh w pld-linux.org
Nie, 20 Lut 2005, 13:25:15 CET
On Sun, Feb 20, 2005 at 12:19:39PM +0100, Paweł Sikora wrote:
> On Sunday 20 of February 2005 11:55, Jakub Bogusz wrote:
> > On Sun, Feb 20, 2005 at 11:22:57AM +0100, Paweł Sikora wrote:
> > > Poza tym ta wersja jest popsuta.
> > >
> > > # gcc -O tmp.c -g -o tmp
> > > # strip tmp
> > > BFD: tmp: warning: Empty loadable segment detected, is this intentional ?
> > > BFD: tmp: warning: Empty loadable segment detected, is this intentional ?
> > > strip: there are no sections to be copied!
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to chyba jakis zart.
> > >
> > > # echo $?
> > > 1
> >
> > Co w tmp.c?
>
> pusty main.
>
> > $ echo 'int main() { }' > tmp.c
> > $ gcc -O tmp.c -g -o tmp
> > $ strip tmp
> > $ echo $?
> > 0
>
> j.w.
>
> > gcc-3.3.5-1, binutils-2.15.94.0.2.2-1.
glibc z rev. 1.570 bez comdat, gdyby to miało znaczenie
> gcc-4.0.0-0.20050213.3, binutils-2.15.94.0.2.2-1
> sprawdzilem tez poprzednia wersje binutilsow i ten sam blad.
> moze gcc cos zle generuje, mozesz pokazac readelf z twojego `tmp` ?
:r! readelf -a /tmp/tmp
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x80482c0
Start of program headers: 52 (bytes into file)
Start of section headers: 1848 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 26
Section header string table index: 25
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 08048134 000134 000013 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 08048148 000148 000020 00 A 0 0 4
[ 3] .hash HASH 08048168 000168 000028 04 A 4 0 4
[ 4] .dynsym DYNSYM 08048190 000190 000050 10 A 5 1 4
[ 5] .dynstr STRTAB 080481e0 0001e0 000059 00 A 0 0 1
[ 6] .gnu.version VERSYM 0804823a 00023a 00000a 02 A 4 0 2
[ 7] .gnu.version_r VERNEED 08048244 000244 000020 00 A 5 1 4
[ 8] .rel.dyn REL 08048264 000264 000008 08 A 4 0 4
[ 9] .rel.plt REL 0804826c 00026c 000008 08 A 4 11 4
[10] .init PROGBITS 08048274 000274 000017 00 AX 0 0 4
[11] .plt PROGBITS 0804828c 00028c 000020 04 AX 0 0 4
[12] .text PROGBITS 080482c0 0002c0 0001d8 00 AX 0 0 64
[13] .fini PROGBITS 08048498 000498 00001b 00 AX 0 0 4
[14] .rodata PROGBITS 080484b4 0004b4 000008 00 A 0 0 4
[15] .eh_frame PROGBITS 080484bc 0004bc 000004 00 A 0 0 4
[16] .ctors PROGBITS 080494c0 0004c0 000008 00 WA 0 0 4
[17] .dtors PROGBITS 080494c8 0004c8 000008 00 WA 0 0 4
[18] .jcr PROGBITS 080494d0 0004d0 000004 00 WA 0 0 4
[19] .dynamic DYNAMIC 080494d4 0004d4 0000c8 08 WA 5 0 4
[20] .got PROGBITS 0804959c 00059c 000004 04 WA 0 0 4
[21] .got.plt PROGBITS 080495a0 0005a0 000010 04 WA 0 0 4
[22] .data PROGBITS 080495b0 0005b0 00000c 00 WA 0 0 4
[23] .bss NOBITS 080495bc 0005bc 000004 00 WA 0 0 4
[24] .comment PROGBITS 00000000 0005bc 0000b4 00 0 0 1
[25] .shstrtab STRTAB 00000000 000670 0000c7 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)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4
INTERP 0x000134 0x08048134 0x08048134 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.2]
LOAD 0x000000 0x08048000 0x08048000 0x004c0 0x004c0 R E 0x1000
LOAD 0x0004c0 0x080494c0 0x080494c0 0x000fc 0x00100 RW 0x1000
DYNAMIC 0x0004d4 0x080494d4 0x080494d4 0x000c8 0x000c8 RW 0x4
NOTE 0x000148 0x08048148 0x08048148 0x00020 0x00020 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
PAX_FLAGS 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
03 .ctors .dtors .jcr .dynamic .got .got.plt .data .bss
04 .dynamic
05 .note.ABI-tag
06
07
Dynamic section at offset 0x4d4 contains 20 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x8048274
0x0000000d (FINI) 0x8048498
0x00000004 (HASH) 0x8048168
0x00000005 (STRTAB) 0x80481e0
0x00000006 (SYMTAB) 0x8048190
0x0000000a (STRSZ) 89 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x80495a0
0x00000002 (PLTRELSZ) 8 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x804826c
0x00000011 (REL) 0x8048264
0x00000012 (RELSZ) 8 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x8048244
0x6fffffff (VERNEEDNUM) 1
0x6ffffff0 (VERSYM) 0x804823a
0x00000000 (NULL) 0x0
Relocation section '.rel.dyn' at offset 0x264 contains 1 entries:
Offset Info Type Sym.Value Sym. Name
0804959c 00000406 R_386_GLOB_DAT 00000000 __gmon_start__
Relocation section '.rel.plt' at offset 0x26c contains 1 entries:
Offset Info Type Sym.Value Sym. Name
080495ac 00000107 R_386_JUMP_SLOT 00000000 __libc_start_main
There are no unwind sections in this file.
Symbol table '.dynsym' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 240 FUNC GLOBAL DEFAULT UND __libc_start_main w GLIBC_2.0 (2)
2: 080484b8 4 OBJECT GLOBAL DEFAULT 14 _IO_stdin_used
3: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses
4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
Histogram for bucket list length (total of 3 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 2 ( 66.7%) 50.0%
2 1 ( 33.3%) 100.0%
Version symbols section '.gnu.version' contains 5 entries:
Addr: 000000000804823a Offset: 0x00023a Link: 4 (.dynsym)
000: 0 (*local*) 2 (GLIBC_2.0) 1 (*global*) 0 (*local*)
004: 0 (*local*)
Version needs section '.gnu.version_r' contains 1 entries:
Addr: 0x0000000008048244 Offset: 0x000244 Link to section: 5 (.dynstr)
000000: Version: 1 File: libc.so.6 Cnt: 1
0x0010: Name: GLIBC_2.0 Flags: none Version: 2
Notes at offset 0x00000148 with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_VERSION (version)
--
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/
Więcej informacji o liście dyskusyjnej pld-devel-pl