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: [patch] S/390: Optimize 64-bit local relocs -> section relocs [with the patch now]


On Mon, 2008-04-14 at 22:39 +0200, Jan Kratochvil wrote:
> in the patch
> 	http://sources.redhat.com/ml/binutils/2002-07/msg00036.html
> 
> you disallowed non-pc-rel relocs to merge sections for both 31-bit and 64-bit
> S/390.
> 
> But the comment there references only unspecific 31-bit problems.
> 
> Is it safe to permit again the non-pc-rel relocs at least on 64-bit s/390?
> Linux kernel built with this patch runs fine but not sure about other programs.
> 
> The patch reduces s390x Linux kernel rpms size base+debuginfo 25M+66M -> 6M+60M.
> 
> 
> (Some of the info was found by Jakub Jelinek.)

In principle the set of 64 bit relocation is a superset of the 31 bit
relocations. So if there is a problem with specific relocations due to
merge sections that problem is there for 64 bit as well. As far as I
remember the problem have been relocations to strings where the compiler
used a "short" relocation but the linker decided to merge the strings
which moved it to a place where the short relocation could not reach it.
The 64 bit gcc usually (always?) uses larl to get the address of a
string, which make this problem disappear on 64 bit. But in principle it
is still there I'm afraid. What we could do is to test for the size of
the operand of the fixup, it if is 4 or more bytes then we can safely
allow the adjustment. 

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.



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