This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: hppa, global symbols and the BL instruction
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sourceware dot org
- Cc: fw at deneb dot enyo dot de
- Date: Sat, 10 Dec 2005 15:30:35 -0500 (EST)
- Subject: Re: hppa, global symbols and the BL instruction
> 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)