bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/11953] objcopy is broken


From: hjl dot tools at gmail dot com
Subject: [Bug binutils/11953] objcopy is broken
Date: 28 Aug 2010 13:32:49 -0000

------- Additional Comments From hjl dot tools at gmail dot com  2010-08-28 
13:32 -------
(In reply to comment #3)
> What toolchain produced DivaP?  I'm asking because the headers are not
> consistent.  If you look at section header offsets and program header offsets,
> you'll see that .note.ABI-tag is part of the first PT_LOAD header.  The header
> p_paddr and p_offset along with the section sh_offset gives .note.ABI-tag a
> section lma of 0x8049094.  However, the PT_NOTE header also contains
> .note.ABI-tag, but the PT_NOTE p_paddr says the section lma should be 
> 0x8048094.
> 

I got

There are 19 section headers, starting at offset 0x1afa6c:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .init             PROGBITS        080480b4 0010b4 000031 00  AX  0   0  4
  [ 2] .text             PROGBITS        080480f0 0010f0 15fbac 00  AX  0   0 16
  [ 3] .fini             PROGBITS        081a7c9c 160c9c 00001c 00  AX  0   0  4
  [ 4] .rodata           PROGBITS        081a7cc0 160cc0 0482aa 00   A  0   0 32
  [ 5] __libc_subinit    PROGBITS        081eff6c 1a8f6c 00000c 00   A  0   0  4
  [ 6] __libc_subfreeres PROGBITS        081eff78 1a8f78 000020 00   A  0   0  4
  [ 7] __libc_atexit     PROGBITS        081eff98 1a8f98 000004 00   A  0   0  4
  [ 8] .data             PROGBITS        081f0fa0 1a8fa0 0025b0 00  WA  0   0 32
  [ 9] .eh_frame         PROGBITS        081f3550 1ab550 000220 00  WA  0   0  4
  [10] .ctors            PROGBITS        081f3770 1ab770 000008 00  WA  0   0  4
  [11] .dtors            PROGBITS        081f3778 1ab778 000008 00  WA  0   0  4
  [12] .got              PROGBITS        081f3780 1ab780 000010 04  WA  0   0  4
  [13] .bss              NOBITS          081f37a0 1ab790 01c288 00  WA  0   0 32
  [14] .comment          PROGBITS        00000000 1ab790 002b32 00      0   0  1
  [15] .note.ABI-tag     NOTE            08048094 001094 000020 00   A  0   0  4
  [16] .note             NOTE            0820fa28 1ae2c2 0016bc 00      0   0  1
  [17] .gnu.warning.llse PROGBITS        0820fa40 1af980 00003f 00      0   0 32
  [18] .shstrtab         STRTAB          00000000 1af9bf 0000ad 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Elf file type is EXEC (Executable file)
Entry point 0x80480f0
There are 3 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08047000 0x08048000 0x1a8f9c 0x1a8f9c R E 0x1000
  LOAD           0x1a8fa0 0x081f0fa0 0x081f0fa0 0x027f0 0x1ea88 RW  0x1000
  NOTE           0x001094 0x08048094 0x08048094 0x00020 0x00020 R   0x4

 Section to Segment mapping:
  Segment Sections...
   00     .init .text .fini .rodata __libc_subinit __libc_subfreeres
__libc_atexit .note.ABI-tag 
   01     .data .eh_frame .ctors .dtors .got .bss 
   02     .note.ABI-tag 

There are

  [15] .note.ABI-tag     NOTE            08048094 001094 000020 00   A  0   0  4

and

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08047000 0x08048000 0x1a8f9c 0x1a8f9c R E 0x1000
  LOAD           0x1a8fa0 0x081f0fa0 0x081f0fa0 0x027f0 0x1ea88 RW  0x1000
  NOTE           0x001094 0x08048094 0x08048094 0x00020 0x00020 R   0x4

LMA is the BFD thing. The only problem is VirtAddr != PhysAddr. But
ELF spec says

--
p_paddr
    On systems for which physical addressing is relevant, this member
is reserved for the segment's physical address. Because System V ignores
physical addressing for application programs, this member has unspecified
contents for executable files and shared objects.
---

We can ignore it.

-- 


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

------- 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]