[PATCH][gold] Fix the value of "dot" symbol in an empty section.

Igor Kudrin ikudrin@accesssoftek.com
Wed Oct 26 12:02:00 GMT 2016


gold may assign an invalid value to symbol "dot" in a rare case when
the section, where the assignment is located, is empty, and, at the
same time, some orphan sections are put just before it. In that case,
you will get different values if you take the value of "dot" symbol
inside the section or if you take ADDR of it.

Best regards,
Igor Kudrin


	* script-sections.cc
	(Output_section_definition::finalize_symbols): Use
	this->evaluated_address_ to initialize variable "address".
	* testsuite/Makefile.am (script_test_18): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/script_test_18.s: New test source file.
	* testsuite/script_test_18.sh: New test script.
	* testsuite/script_test_18.t: New test linker script.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gold-dot-in-empty-after-orphan.patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20161026/eedf8e0a/attachment.txt>

More information about the Binutils mailing list