This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Resubmit
- To: Nick Clifton <nickc at cygnus dot com>
- Subject: Re: Resubmit
- From: Momchil Velikov <velco at fadata dot bg>
- Date: Thu, 18 May 2000 11:04:48 +0200
- CC: gorton at scrugs dot lkg dot dec dot com, binutils at sourceware dot cygnus dot com
- References: <200005171943.MAA31299@elmo.cygnus.com>
Nick Clifton wrote:
>
> Hi Gordon,
>
> : I'm resubmitting the --emit-relocs patch - I made an authorship omission
> : (naughty, naughty) in the ChangeLogs and NO_HELP became TWO_DASHES in
> : ld/lexsup.c for the patch.
> :
> : Due to corporate silliness (stupidity, actually), it turns out that I
> : have to be the person who submits this particular patch, even though
> : all of the original work was done by Bharadwaj <sby@scrugs.lkg.dec.com>
> : Proof of Dilbert being alive and well. (Sigh)
> :
> : Rick (for myself and Bharadwaj)
>
> Thanks for submitting this patch.
>
> I have now applied it to the sources.
I'm glad to hear that. At least, I no longer have to carry my
own patch
http://sourceware.cygnus.com/ml/binutils/2000-03/msg00180.html
through the years :-)
However, I'd suggest:
I. Reverting this hunk from Rick (for himself and Bharadwaj)'s patch
@ -4306,7 +4306,7 @@
if (o != NULL)
o->target_index = bfd_get_symcount (abfd);
elfsym.st_shndx = i;
- if (info->relocateable || o == NULL)
+ if (info->relocateable || info->emitrelocations || o == NULL)
elfsym.st_value = 0;
else
elfsym.st_value = o->vma;
The value of the symbol has to be a virtual address in an ET_EXEC
object.
II. Applying this from my patch:
@@ -5574,7 +5574,10 @@
Elf_Internal_Sym *isym;
asection *sec;
- irela->r_offset += o->output_offset;
+ if (finfo->info->relocateable )
+ irela->r_offset += o->output_offset;
+ else
+ irela->r_offset += o->output_offset + o->output_section->vma;
r_symndx = ELF_R_SYM (irela->r_info);
The same as above applies to to r_offset field in relocation entries.
Both hunks are in elflink.h
Regards,
-velco