PATCH COMMITTED: Output local section symbol relocs to merge sections

Ian Lance Taylor
Mon Apr 7 22:49:00 GMT 2008

This patch adds support for outputting relocs against local section
symbols defined in merge sections.  I originally thought this case
could not happen because I couldn't figure out any way to generate
code for it.  But then I did figure out how to generate it, if we
permit x86-64 non-PIC object files to go into shared libraries.  Which
we don't, but that's OK, the case will arise for other processors.

I committed this patch to make it work, including a test case which
would trigger it if we could.


2008-04-07  Ian Lance Taylor  <>

	* (Output_reloc<SHT_REL>::local_section_offset): Add
	addend parameter.  Change caller.  Handle merge sections.
	(Output_reloc<SHT_REL>::symbol_value): Change parameter type from
	Address to Addend.  Don't add in the result of
	local_section_offset, pass down the addend and use the returned
	* output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
	Update declarations of local_section_offset and symbol_value.
	* testsuite/ (t18): New function.
	* testsuite/ (f18): New function.
	* testsuite/ (main): Call t18.
	* testsuite/two_file_test.h (t18, f18): Declare.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 6021 bytes
Desc: Output local section symbol relocs to merge sections
URL: <>

More information about the Binutils mailing list