[parisc-linux] Get rid of %r8 linker stubs

Alan Modra alan@linuxcare.com.au
Fri, 23 Jun 2000 11:45:16 +1000 (EST)


Hi Paul,
   Thanks for testing this out for me.  Did you have any success stories
to report with the latest binutils patch?  eg. Does tar still run?

On Thu, 22 Jun 2000, Paul Bame wrote:

> Well the good news is I can (with some trouble) link a native
> binutils.  The bad news is that the kernel won't link.  To wit -
> 
> hppa1.1-linux-ld: fs/fs.o: cannot reach stub 080e89b4_00000000_printk
> hppa1.1-linux-ld: fs/fs.o: cannot handle relocation R_PARISC_PCREL17F for printk at 0x3fc98 in .text
> 
> This follows a 'make clean'.  I only re-built the new binutils and not
> gcc, if that matters.

No, gcc doesn't need to be rebuilt.  The problem here (I think - I'm going
to build a kernel in a the moment) is the silly use of "ld -r" in the
kernel build process.  This has the unfortunate effect of concatenating
all the .text sections, making some too large for a branch to reach its
stub section.  Of course this same thing can happen with very large object
files.

One fairly simple work-around is to use -ffunction-sections when compiling,
as then you need a truely enormous function (> 4*2**(17-1) bytes long)
before you'll get "cannot reach stub"  Also, gcc has support for handling
even these enormous functions.

Regards, Alan Modra
-- 
Linuxcare.  Support for the Revolution.