Fix incremental tests using gcc 9, which adds Gnu properties sections.

During an incremental link, we should simply ignore the Gnu properties
sections. We were not handling them properly -- failing to process the
properties from the base file. While that could be fixed, the property
sections are meant for deployed binaries, and incremental linking is
for development, so keeping the properties sections just adds to the
likelihood of forcing a full link sooner.

gold/
	PR gold/23539
	* object.cc (Sized_relobj_file::layout_gnu_property_section): Ignore
	Gnu properties during incremental links.
This commit is contained in:
Cary Coutant 2020-12-13 15:20:10 -08:00
parent f12650bff1
commit 387a56a543
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2020-12-13 Cary Coutant <ccoutant@gmail.com>
PR gold/23539
* object.cc (Sized_relobj_file::layout_gnu_property_section): Ignore
Gnu properties during incremental links.
2020-12-13 Cary Coutant <ccoutant@gmail.com> 2020-12-13 Cary Coutant <ccoutant@gmail.com>
PR gold/24123 PR gold/24123

View File

@ -1304,6 +1304,10 @@ Sized_relobj_file<size, big_endian>::layout_gnu_property_section(
Layout* layout, Layout* layout,
unsigned int shndx) unsigned int shndx)
{ {
// We ignore Gnu property sections on incremental links.
if (parameters->incremental())
return;
section_size_type contents_len; section_size_type contents_len;
const unsigned char* pcontents = this->section_contents(shndx, const unsigned char* pcontents = this->section_contents(shndx,
&contents_len, &contents_len,