[davidm@napali.hpl.hp.com: Re: [PATCH] i386 vsyscall DSO implementation]

H. J. Lu hjl@lucon.org
Sat Jun 14 03:22:00 GMT 2003


Can someone comment on it?


H.J.
---
----- Forwarded message from David Mosberger <davidm@napali.hpl.hp.com> -----

Delivered-To: hjl@localhost.lucon.org
From: David Mosberger <davidm@napali.hpl.hp.com>
Date: Fri, 13 Jun 2003 20:02:43 -0700
To: hjl@lucon.org
Cc: Roland McGrath <roland@redhat.com>, davidm@hpl.hp.com
Subject: Re: [PATCH] i386 vsyscall DSO implementation
X-Mailer: VM 7.07 under Emacs 21.2.1
Reply-To: davidm@hpl.hp.com
X-URL: http://www.hpl.hp.com/personal/David_Mosberger/

HJ,

Would you be OK with getting this bug fix into the binutils CVS?
Without the attached patch, segment-relative relocations do not work
correctly if the target symbol (effective address) is in a different
section than the relocation.

Here is a test case:

$ cat t.S
        .proc start
start:  .prologue
        .altrp b6
        br.ret.sptk b6
        .endp start
$ cat t.lds
SECTIONS {
        . = SIZEOF_HEADERS;
        .IA_64.unwind_info : { *(.IA_64.unwind_info) } :dat
        .IA_64.unwind : { *(.IA_64.unwind*) } :dat :unw
        . = 0xa0000;
        .text : { *(.text) } :txt
}
PHDRS {
  dat PT_LOAD FILEHDR PHDRS FLAGS(4);
  txt PT_LOAD FLAGS(1);
  unw 0x70000001;
}
$ gcc -c t.c
$ ld -static -Tt.lds t.o
$ readelf -u a.out | fgrep '<'
<>: [0x0-0x10], info at +0xe8

With the patch applied, the last command instead yields the desired
values:

$ readelf -u a.out | fgrep '<'
<start>: [0xa0000-0xa0010], info at +0xe8

	--david

-------------------------------------------------------
From: Roland McGrath <roland@redhat.com>
To: davidm@hpl.hp.com
Subject: Re: [PATCH] i386 vsyscall DSO implementation
Date: Fri, 13 Jun 2003 19:03:44 -0700

I'm calling it an ld bug.

*** bfd/elfxx-ia64.c.~1.83.~
--- bfd/elfxx-ia64.c
***************
*** 4325,4331 ****
                {
                  int i;
                  for (i = m->count - 1; i >= 0; i--)
!                   if (m->sections[i] == sym_sec->output_section)
                      break;
                  if (i >= 0)
                    break;
--- 4325,4331 ----
                {
                  int i;
                  for (i = m->count - 1; i >= 0; i--)
!                   if (m->sections[i] == input_section->output_section)
                      break;
                  if (i >= 0)
                    break;

----- End forwarded message -----



More information about the Binutils mailing list