This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: farcall-section test


On Tuesday 24 February 2009, Daniel Jacobowitz wrote:
> On Tue, Feb 24, 2009 at 12:18:30PM +0000, Paul Brook wrote:
> > This test is bogus. The real bug is that the user (i.e. the source
> > assembly) is calling something that is not a function symbol. We should
> > not be issuing these relocations in the first place, certainly not for
> > EABI targets.
> >
> > If the user is requesting call relocations against non-functions symbols
> > then it really doesn't matter what we do. The code is already broken.
> > There's nothing special about long branch stubs in this case, *all* call
> > relocations are likely to break if the target is Thumb.
>
> I'm confused.  Why does it matter for EABI targets?  We have mapping
> symbols; the linker could easily do the right thing.

Hmm, I guess so.

Actually, reading the AAELF again, it says "T is 1 if the target symbol has 
type STT_FUNC and the symbol addresses a Thumb instruction". i.e. 
non-function symbols are treated as ARM.

Also relevant is:
"A linker may use a veneer [...] if [...] The target symbol has type 
STT_FUNC."

i.e. an error is the correct behavior here. IMO this makes sense: If a symbol 
isn't marked as a function, we can't really be sure it's actually a public 
entry point, and probably can't safely clobber r12.

Paul


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