[binutils-gdb] Fix incremental tests using gcc 9, which adds Gnu properties sections.

Cary Coutant ccoutant@sourceware.org
Sun Dec 13 23:29:41 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=387a56a5435500ba2d2eac3fe76de1f400381cbe

commit 387a56a5435500ba2d2eac3fe76de1f400381cbe
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Sun Dec 13 15:20:10 2020 -0800

    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.

Diff:
---
 gold/ChangeLog | 6 ++++++
 gold/object.cc | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index bfb7a7002ac..0f052cc46a3 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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>
 
 	PR gold/24123
diff --git a/gold/object.cc b/gold/object.cc
index c0d0f0289fc..23ce2064daf 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -1304,6 +1304,10 @@ Sized_relobj_file<size, big_endian>::layout_gnu_property_section(
     Layout* layout,
     unsigned int shndx)
 {
+  // We ignore Gnu property sections on incremental links.
+  if (parameters->incremental())
+    return;
+
   section_size_type contents_len;
   const unsigned char* pcontents = this->section_contents(shndx,
 							  &contents_len,


More information about the Binutils-cvs mailing list