This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld issues with phdr test


"H . J . Lu" <hjl@lucon.org> writes:

> On Sun, Apr 29, 2001 at 08:01:00PM +0200, Andreas Jaeger wrote:
> > "H . J . Lu" <hjl@lucon.org> writes:
> > 
> > > On Sun, Apr 29, 2001 at 12:14:19PM +0200, Andreas Jaeger wrote:
> > > > 
> > > > 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
> > > 
> > > Why doesn't 0x100000 work for you?
> > 
> > I still get this broken output - no change at all:
> > 
> > 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-
> > 
> > 
> 
> I guess I didn't follow you.
> 
> 1. What is broken? How is it broken?

The output for i386 is :
tmpdir/phdrs:     file format elf32-i386

Program Header:
    PHDR off    0x00000034 vaddr 0x00080034 paddr 0x00080034 align 2**2
         filesz 0x00000060 memsz 0x00000060 flags r--
    LOAD off    0x00000000 vaddr 0x00080000 paddr 0x00080000 align 2**12
         filesz 0x00000098 memsz 0x00000098 flags r-x
    LOAD off    0x00000098 vaddr 0x00080098 paddr 0x00080098 align 2**12
         filesz 0x00000004 memsz 0x00000004 flags rw-

For x86-64 I get different values, for PHDR vaddr and paddr are
wrong (there's an offset of 0x80000 missing):
> >     PHDR off    0x0000000000000040 vaddr 0x0000000000000040 paddr 0x0000000000000040 align 2**3
> >          filesz 0x00000000000000a8 memsz 0x00000000000000a8 flags r--


The first LOAD off is also wrong, the vaddr, paddr and memsz values
look broken:

> >     LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**20
> >          filesz 0x00000000000800ec memsz 0x00000000000800ec flags r-x

Only the second LOAD off look fine:
> >     LOAD off    0x00000000000800ec vaddr 0x00000000000800ec paddr 0x00000000000800ec align 2**20
> >          filesz 0x0000000000000004 memsz 0x0000000000000004 flags rw-

> 2. Were you saying you got different results when you ran test by
> hand vs. did "make check"?

I get the same results whether running by hand or with make check.  I
only get a correct result if I use 0x1000 instead of 0x100000.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]