This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Please comment: A patch for elf32-i386.c
On Fri, Feb 09, 2001 at 02:16:22PM +1100, Alan Modra wrote:
> Hi H.J.,
> I forgot to mention that the patch you posted is probably incomplete,
> because you need to change relocate_section to match check_relocs.
>
> Basically, the test in relocate_section case R_386_32, R_386_PC32 should
> be the same as the one in check_relocs, with some extra conditions for
> relocs dropped by discard_relocs.
>
After a second look, I think my patch is ok. It only adds one extra
case. That is R_386_PC32, -Bsymbolic and weak definition. We have
already saved it in the pcrel_relocs_copied field. I don't think we
should copy the relocation for that case in relocate_section. Now, we
only have to make sure discard_relocs does discard this extra case. We
have
/* If a symbol has been forced local or we have found a regular
definition for the symbolic link case, then we won't be needing
any relocs. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
&& ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
|| info->symbolic))
{
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
}
I think my extra case is covered here. If there is no more objection, I
will check in my patch.
--
H.J. Lu (hjl@valinux.com)