[gold patch] Fix handling of merge sections during incremental update

ccoutant@gmail.com ccoutant@gmail.com
Sun Dec 13 23:32:02 GMT 2020


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.

2020-12-13  Cary Coutant  <ccoutant@gmail.com>

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

diff --git a/gold/layout.cc b/gold/layout.cc
index 8563f11099..8acfb960d1 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -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();
 


More information about the Binutils mailing list