This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ld issues with phdr test
- To: binutils at sources dot redhat dot com
- Subject: ld issues with phdr test
- From: Andreas Jaeger <aj at suse dot de>
- Date: 29 Apr 2001 12:14:19 +0200
On x86-64 I have a problem with the test from ld-scripts called phdr.
The output is:
gromit:/builds/sourceware-src/cross/ld:[0]$ x86_64-unknown-linux-objdump --private a.out
a.out: file format elf64-x86-64
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000000000040 paddr 0x0000000000000040 align 2**3
filesz 0x00000000000000a8 memsz 0x00000000000000a8 flags r--
LOAD off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**20
filesz 0x00000000000800ec memsz 0x00000000000800ec flags r-x
LOAD off 0x00000000000800ec vaddr 0x00000000000800ec paddr 0x00000000000800ec align 2**20
filesz 0x0000000000000004 memsz 0x0000000000000004 flags rw-
Running ld manually I get an output that looks ok to me.
gromit:/builds/sourceware-src/cross/ld:[0]$ ./ld-new -M tmpdir/phdrs.o -T /cvs/sourceware-src/ld/testsuite/ld-scripts/phdrs.t --verbose -V
GNU ld version 2.11.90 (with BFD 2.11.90)
Supported emulations:
elf_x86_64
elf_i386
i386linux
GNU ld version 2.11.90 (with BFD 2.11.90)
Supported emulations:
elf_x86_64
elf_i386
i386linux
attempt to open tmpdir/phdrs.o succeeded
tmpdir/phdrs.o
Memory Configuration
Name Origin Length Attributes
*default* 0x0000000000000000 0xffffffffffffffff
Linker script and memory map
LOAD tmpdir/phdrs.o
0x00000000000800e8 .=(0x80000+SIZEOF_HEADERS)
.text 0x00000000000800e8 0x4
*(.text)
.text 0x00000000000800e8 0x4 tmpdir/phdrs.o
.data 0x00000000000800ec 0x4
*(.data)
.data 0x00000000000800ec 0x4 tmpdir/phdrs.o
/DISCARD/
*(.*)
OUTPUT(a.out elf64-x86-64)
I've noticed that bfd/elf64-x86-64.c has:
#define ELF_MAXPAGESIZE 0x100000
but ld/emulparms/elf-x86_64.sh uses:
MAXPAGESIZE=0x1000
Changing elf64-x86-64.c to 0x1000 fixes the problem:
gromit:/builds/sourceware-src/cross/ld:[0]$ x86_64-unknown-linux-objdump --private a.out
a.out: file format elf64-x86-64
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000000080040 paddr 0x0000000000080040 align 2**3
filesz 0x00000000000000a8 memsz 0x00000000000000a8 flags r--
LOAD off 0x0000000000000000 vaddr 0x0000000000080000 paddr 0x0000000000080000 align 2**12
filesz 0x00000000000000ec memsz 0x00000000000000ec flags r-x
LOAD off 0x00000000000000ec vaddr 0x00000000000800ec paddr 0x00000000000800ec align 2**12
filesz 0x0000000000000004 memsz 0x0000000000000004 flags rw-
But I prefer to use 0x100000 in both files which this doesn't work
for me:-(. Is this really the problem? Is the constant used
elsewhere? Any ideas?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj