[PATCH] avoid premature errors when linking with relaxation

Bob Wilson bwilson@tensilica.com
Tue Feb 18 18:08:00 GMT 2003


This patch fixes a problem that we have encountered with the linker.  The 
problem occurs when the original sections from the input files are too big to 
fit in the space available in the output section, but when linker relaxation 
is enabled, the sections shrink enough so that they fit.  This should be OK 
but the linker reports it as an error.  Even if the final result of the 
relaxation is still too big, the linker ends up reporting the error multiple 
times, once for each iteration of relaxation.

The root cause is that lang_size_sections() always calls os_region_check().  
It seems that os_region_check() should be called only for the last invocation 
of lang_size_sections().  The patch adds another argument to 
lang_size_sections to indicate whether os_region_check() should be called.

This patch has been tested extensively with the Xtensa port of binutils 2.11 
and a fair amount with 2.12.  After porting the patch to binutils mainline, I 
built it for x86-linux and ran the ld testsuite without any regressions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-check-regions.diff
Type: text/x-diff
Size: 15100 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20030218/00dc0bd1/attachment.bin>


More information about the Binutils mailing list