]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix incremental linking with rodata merge sections.
authorCary Coutant <ccoutant@gmail.com>
Sun, 13 Dec 2020 23:19:41 +0000 (15:19 -0800)
committerCary Coutant <ccoutant@gmail.com>
Sun, 13 Dec 2020 23:27:25 +0000 (15:27 -0800)
When processing the incremental update, incoming .rodata merge sections
do not match the corresponding section in the base file, because the
SHF_MERGE flag had not been masked out of the latter.

gold/
PR gold/24123
* layout.cc (Layout::init_fixed_output_section): Mask out flags that
should be ignored when matching sections.

gold/ChangeLog
gold/layout.cc

index e152e1ed6980ef061d207aa1b79267d58fd2f82c..bfb7a7002ac5ac25b16860cd464ca79ad3aab065 100644 (file)
@@ -1,3 +1,9 @@
+2020-12-13  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/24123
+       * layout.cc (Layout::init_fixed_output_section): Mask out flags that
+       should be ignored when matching sections.
+
 2020-12-07  Alan Modra  <amodra@gmail.com>
 
        * plugin.cc (Plugin_recorder::init): Replace strncpy with memcpy.
index 8563f110995bd1246d641f4d08db08ea453a36e9..8acfb960d123fb3643031c901797a470bc6c8d99 100644 (file)
@@ -1099,7 +1099,8 @@ Layout::init_fixed_output_section(const char* name,
   typename elfcpp::Elf_types<size>::Elf_Addr sh_addr = shdr.get_sh_addr();
   typename elfcpp::Elf_types<size>::Elf_Off sh_offset = shdr.get_sh_offset();
   typename elfcpp::Elf_types<size>::Elf_WXword sh_size = shdr.get_sh_size();
-  typename elfcpp::Elf_types<size>::Elf_WXword sh_flags = shdr.get_sh_flags();
+  typename elfcpp::Elf_types<size>::Elf_WXword sh_flags =
+      this->get_output_section_flags(shdr.get_sh_flags());
   typename elfcpp::Elf_types<size>::Elf_WXword sh_addralign =
       shdr.get_sh_addralign();