gold patch committed: Handle odd section symbols with -r

Ian Lance Taylor iant@google.com
Sat Feb 28 00:15:00 GMT 2009


The last case in PR 7091 is about a section symbol for a SHT_REL section
when linking with -r.  Such a case can not be generated by current
versions of gas.  However, they are valid ELF.  gold was crashing trying
to determine the value to use for such a section symbol.  In fact gold
will never emit the section symbol, and it would be bizarre in the
extreme if a relocation entry referenced the symbol.  However, there is
no need to crash.  I committed this patch to fall back to using the
start of the output section as the address for such a section symbol.
This is not really right, but then nothing is really right if anything
actually needs the value of the symbol.

Ian


2009-02-27  Ian Lance Taylor  <iant@google.com>

	PR 7091
	* output.cc (Output_section::find_starting_output_address): Rename
	from starting_output_address; add PADDR parameter; change return
	type.
	* output.h (class Output_section): Declare
	find_starting_output_address instead of starting_output_address.
	* object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
	section symbol for which we can't find a merge section.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 5330 bytes
Desc: Handle odd section symbols with -r
URL: <https://sourceware.org/pipermail/binutils/attachments/20090228/dc722fd3/attachment.bin>


More information about the Binutils mailing list