This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH/RFA] sh-elf: Unnecessary relocations
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 26 Sep 2002 17:59:26 -0400
- Subject: Re: [PATCH/RFA] sh-elf: Unnecessary relocations
- References: <200209262147.g8QLlpO11592@r-rr.iij4u.or.jp>
On Fri, Sep 27, 2002 at 06:26:52AM +0900, kaz Kojima wrote:
> Hi,
>
> Current gas for sh-elf generates some unnecessary PC relative
> relocations when the symbol is global. For example, I've got
> two relocations:
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000000 R_SH_DIR8WPL foo
> 00000006 R_SH_IND12W foo
>
> for the following small source
>
> .text
> mova foo,r0
> rts
> nop
> .global foo
> foo:
> bra foo
> nop
>
> and slightly old gas doesn't make such relocations for the same
> source. With the following patch, gas shows the same behavior
> as the old one. Regression tested on sh-unknown-linux-gnu.
Isn't that incorrect ELF, though? Can't the definition of foo end up
coming from another shared object?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer