hppa, global symbols and the BL instruction

John David Anglin dave@hiauly1.hia.nrc.ca
Sat Dec 10 20:30:00 GMT 2005


> 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.
In that case, the branch would be out of range.  However, I think
it should be up to the linker to issue an error.

One way to the avoid the problem is to use a local alias for foo.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)



More information about the Binutils mailing list