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: [committed] Ensure pc-relative calls can reach their target on


> >> I believe that is true, certainly the code I have adapted from there
> >> comes with that restriction. Are there any ports that can do long
> >> branch stubs in a more fine-grained way? I assume it would involve
> >> using the linker relaxing hooks.
> >
> > I know the HP SOM and ELF linkers do this for hppa.
> 
> Only because the compilers cooperate by imposing a maximum size for
> text sections. If a text section would grow beyond the range of a
> short branch, the compiler simply starts a new section (with the same
> name). If a single function would be too large, the compiler is
> obligated to generate long branches where short ones would not reach
> the beginning or end of the section. The HP linker never has to insert
> a stub in the middle of an input section.

GCC does something similar for the HP-UX SOM target.  It starts a new section
(new subspace) before each function allowing the linker to insert stubs if
necessary.  If the stub table can't be reached, it generates a long call.
However, it doesn't currently start a new section function for the hppa
ELF targets.  Possibly, this could be addressed using something like .text.1,
.text.2, ...

I'm not aware of support within ELF for multiple unnamed sections.  I
believe the HP linker can do all kinds of interesting things with unnamed
subspaces.  They can have different sort keys, flags, etc.

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]