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


> 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)


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