This is the mail archive of the binutils@sourceware.cygnus.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: Patch for RELATIVE relocation for an non-loaded section


I'm not an expert in this area, but as explained to me, gcc does not use
DWARF for debug information on Linux. Compaq C does. So it is unlikely you
would have run into this. I think the following comment from elf64-sparc.c
explains why this patch is needed for elf64-alpha.c better than I could:


 case R_SPARC_UA16:
   /* When creating a shared object, we must copy these relocs
      into the output file.  We create a reloc section in
      dynobj and make room for the reloc.

      But don't do this for debugging sections -- this shows up
      with DWARF2 -- first because they are not loaded, and
      second because DWARF sez the debug info is not to be
      biased by the load address.  */


You can download the Compaq C compiler for linux at
http://www.unix.digital.com/linux/compaq_c/index.html and reproduce this
with the example I posted. Or I could send you the objects produces by the
compaq C compiler? Let me know what I can do to help.

This problem was still reproducible as of  binutils-2.9.5.0.27.


"H . J . Lu" wrote:

> On Fri, Mar 10, 2000 at 01:34:48PM -0500, Ken Block USG wrote:
> > Same patch again, hopefully, the text is wrapped properly this time.
>
> > catch.zko.dec.com> ccc -c -g foo.c
> > catch.zko.dec.com> ccc foo.o -shared -o libfoo.so
> > catch.zko.dec.com> ccc -o main main.c ./libfoo.so
> > catch.zko.dec.com> ./main
> > foo
> >
> >
> > Relink using the old RH5.2 ld.
> >
> > catch.zko.dec.com> $DECC_STABLE/ld -o libfoo.so -O1 -m elf64alpha -G 8
> > -shared -
> > L/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/lib -L/usr/local/lib
> > -L/usr/alpha-r
> > edhat-linux/lib -L/usr/lib/gcc-lib/alpha-redhat-linux/egcs-2.90.29
> > /usr/lib/comp
> > aq/ccc-6.2.9.002-2/alpha-linux/bin/crti.o
> > /usr/lib/compaq/ccc-6.2.9.002-2/alpha-
> > linux/bin/crtbegin.o foo.o -lgcc -lc -lgcc -lots
> > /usr/lib/compaq/ccc-6.2.9.002-2
> > /alpha-linux/bin/crtend.o
> > /usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crtn.o
>
> I am not sure if I get this right: your patch fixes a bug with linking
> a DSO generated by ld on RedHat 5.2. I don't know enough about it.
>
> H.J.
begin:vcard 
n:Block;Kenneth
x-mozilla-html:FALSE
org:CTG C/C++ Compiler
version:2.1
email;internet:block@zk3.dec.com
adr;quoted-printable:;;110 Spit Brook Road=0D=0AM/S ZKO3-2/W02;Nashua;NH;03062;USA
x-mozilla-cpt:;0
tel;work:603-884-2819
fn:Kenneth Block
end:vcard

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