[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/10515] New: Linker corrupts the paddr and vaddr in program heade
From: |
harry dot he at freescale dot com |
Subject: |
[Bug ld/10515] New: Linker corrupts the paddr and vaddr in program header |
Date: |
13 Aug 2009 05:21:03 -0000 |
I am attaching a sample program compiled using two different linker scripts
producing two different ELF files.
The two linker scripts are test_good.lds test_faulty.lds.
There is a trivial difference between two files.
In test_good.lds, 'ro_data' PHDRS entry is in first place.
In test_faulty.lds, 'ro_data' PHDRS entry is in second place.
The two elf files produced are test_good.elf, test_faulty.elf.
'objdump -p' of both the files is shown below.
[sample]$ objdump -p test_good.elf
test_good.elf: file format elf32-big
Program Header:
LOAD off 0x00000000 vaddr 0x0c000000 paddr 0x00100000 align 2**16
filesz 0x00100000 memsz 0x00100000 flags r-x
LOAD off 0x00100000 vaddr 0x00200000 paddr 0x00200000 align 2**16
filesz 0x00100000 memsz 0x00100000 flags rw- 400000
LOAD off 0x00200000 vaddr 0x08000000 paddr 0x08000000 align 2**16
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
LOAD off 0x00200000 vaddr 0x00300000 paddr 0x00300000 align 2**16
filesz 0x00010000 memsz 0x00070000 flags rw-
0x8 off 0x00000000 vaddr 0x01000000 paddr 0x01000000 align 2**0
filesz 0x00000000 memsz 0x07000000 flags rw-
0x8 off 0x00000000 vaddr 0x2c000000 paddr 0x2c000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
0x8 off 0x00000000 vaddr 0x10000000 paddr 0x10000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- a00000
0x8 off 0x00000000 vaddr 0x28000000 paddr 0x28000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
[sample]$ objdump -p test_faulty.elf
test_faulty.elf: file format elf32-big
Program Header:
LOAD off 0x00010000 vaddr 0x00200000 paddr 0x00200000 align 2**16
filesz 0x00100000 memsz 0x00100000 flags rw- 400000
LOAD off 0x00000000 vaddr 0x0bf00000 paddr 0x00000000 align 2**16
filesz 0x00200000 memsz 0x00200000 flags r-x
LOAD off 0x00200000 vaddr 0x08000000 paddr 0x08000000 align 2**16
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
LOAD off 0x00200000 vaddr 0x00300000 paddr 0x00300000 align 2**16
filesz 0x00010000 memsz 0x00070000 flags rw-
0x8 off 0x00000000 vaddr 0x01000000 paddr 0x01000000 align 2**0
filesz 0x00000000 memsz 0x07000000 flags rw-
0x8 off 0x00000000 vaddr 0x2c000000 paddr 0x2c000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
0x8 off 0x00000000 vaddr 0x10000000 paddr 0x10000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- a00000
0x8 off 0x00000000 vaddr 0x28000000 paddr 0x28000000 align 2**0
filesz 0x00000000 memsz 0x04000000 flags rw- 400000
Check that in 'objdump -p test_faulty.elf ' output, the second segement entry
contains paddr as 0 and vaddr as 0x0bf00000. Where is it should have been
vaddr = 0x0c000000, paddr = 0x00100000.
--
Summary: Linker corrupts the paddr and vaddr in program header
Product: binutils
Version: 2.18
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: harry dot he at freescale dot com
CC: bug-binutils at gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: powerpc-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=10515
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/10515] New: Linker corrupts the paddr and vaddr in program header,
harry dot he at freescale dot com <=