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: hppa, global symbols and the BL instruction


* John David Anglin:

>> Could anybody please enlight me why the following does not assemble on
>> HPPA?
>> 
>>        .text
>>	.org . + 262144
>>	.globl  foo
>> foo:
>> 	bl      foo, %r0
>> 
>> (The .org instruction is only used to avoid insert many instructions,
>> which are otherwise required to trigger this bug.)
>> 
>> I would have expect that foo is reachable with a 17-bit displacement
>> even if foo is a global symbol.  But instead, I get this error message:
>> 
>> foo.s:5: Error: Field out of range [-262144..262143] (-262152).
>
> I think the error is a bug.  foo could be overloaded with another
> definition should the above code get linked into a shared library.

Ah, I missed that.

> In that case, the branch would be out of range.  However, I think
> it should be up to the linker to issue an error.

It seems that GAS cannot encode the necessary relocation if the symbol
is more than 64K instructions away from the start of the object file.
It's probably not a bug in GAS.  In any case, the compiler which
generates such assembler files needs to be fixed.


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