This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH/RFA] sh-elf: Unnecessary relocations
Hans-Peter Nilsson <hp@bitrange.com> wrote:
> I think the point is that those relocations are for
> *immediately* nearby addresses; they can't reach more than
> something like 1 << 8 or 1 << 12 bytes. It'd be a gcc bug to
> generate them for global symbols that can be overridden. I
> think the patch should be corrected to check for R_SH_DIR8WPL
> and R_SH_IND12W (or really, the BFD names) since there
> supposedly exists other PC-relative relocations that should be
> generated for global symbols in the same object. That includes
> the 32-bit pcrel reloc (whatever the SH ELF name; I think the
> BFD name is BFD_RELOC_32_PCREL). Right?
Ah, yes. My patch might be overkill. It seems that the old
tc-sh.c handles the following 6 relocations as such relocations:
BFD_RELOC_SH_PCDISP12BY2
BFD_RELOC_SH_PCRELIMM8BY2
BFD_RELOC_SH_PCRELIMM8BY4
BFD_RELOC_8_PCREL
BFD_RELOC_SH_SWITCH16
BFD_RELOC_SH_SWITCH32
I'll make a revised patch with checking these relocations.
Thanks,
kaz