Another bug found by inspection. The ABI says: The linker should warn and clear EF_FRV_PIC when linking FDPIC binaries if it finds any inter-segment relocation, and set it otherwise. But in fact the linker sets EF_FRV_PIC if it sees any inter-segment relocations. There's hardcoded checks for files named "crt0.o" directly above that, too.
Created attachment 2748 [details] Set EF_FRV_PIC by default (for FDPIC). Clear it if any inter-segment relocations are found
Subject: Re: New: Handling of EF_FRV_PIC Hi Guys, > Another bug found by inspection. The ABI says: > > The linker should warn and clear EF_FRV_PIC when linking > FDPIC binaries if it finds any inter-segment relocation, and set it > otherwise. > > But in fact the linker sets EF_FRV_PIC if it sees any inter-segment relocations. I have uploaded a patch to this PR which I think might correct the linker's behaviour, but I am not familiar with FDPIC on the FRV so I may well have made a mistake. Would you guys care to take a look at it ? > There's hardcoded checks for files named "crt0.o" directly above that, too. I am not sure about whether this is important or not, so I have the special case code in. Cheers Nick
Subject: Re: Handling of EF_FRV_PIC On Wed, May 21, 2008 at 10:34:13AM -0000, nickc at redhat dot com wrote: > I have uploaded a patch to this PR which I think might correct the > linker's behaviour, but I am not familiar with FDPIC on the FRV so I may > well have made a mistake. Would you guys care to take a look at it ? I think it looks right, but I am not familiar with FRV at all; I only noticed this while working on SH. Could the flag go in the link info instead of static, on general principles?
The patch does indeed appear to get the code to patch the spec (thanks, Nick!), but I'm concerned that, at this point, it might be wiser to change the spec to match the code, for a couple of kernels and libcs might be relying on the current bug :-(
Subject: Re: Handling of EF_FRV_PIC Hi Alex, Hi Daniel, > The patch does indeed appear to get the code to patch the spec (thanks, Nick!), > but I'm concerned that, at this point, it might be wiser to change the spec to > match the code, for a couple of kernels and libcs might be relying on the > current bug :-( Can we do that ? I would be much happier to leave the code alone and change the documentation ... :-) Cheers Nick
(In reply to comment #1) > Created an attachment (id=2748) > Set EF_FRV_PIC by default (for FDPIC). Clear it if any inter-segment > relocations are found > This patch caused PR 6747.
Proven to destabilise the linker