[gold patch committed] Fix start address of RELRO segment

Ian Lance Taylor iant@google.com
Mon Aug 2 12:02:00 GMT 2010


PR 11866 is about a bug revealed by stripping a shared library linked by
gold with -z relro.  When I looked into this, I found a problem in that
the start address of the RELRO segment might be incorrect, because the
list of sections attached to the segment is not necessarily in address
order.  I committed this patch to fix the problem.  I not sure whether
or not this is the same problem as seen by the reporter of PR 11866, as
the symptoms are different.

Ian


2010-08-02  Ian Lance Taylor  <iant@google.com>

	PR 11866
	* output.cc (Output_segment::set_offset): Search for the first and
	last sections rather than assuming that the list is in order.
	(Output_segment::find_first_and_last_list): New function.
	* output.h (class Output_segment): Update declarations.
	* testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
	(relro_strip_test_SOURCES): New variable.
	(relro_strip_test_DEPENDENCIES): New variable.
	(relro_strip_test_LDFLAGS): New variable.
	(relro_strip_test_LDADD): New variable.
	(relro_strip_test.so): New target.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 4298 bytes
Desc: strip
URL: <https://sourceware.org/pipermail/binutils/attachments/20100802/d3a07354/attachment.bin>


More information about the Binutils mailing list