aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2020-12-13 15:19:41 -0800
committerCary Coutant <ccoutant@gmail.com>2020-12-13 15:27:25 -0800
commitf12650bff1a591357c26e0ef6d7be0323f76fdb8 (patch)
treed0f669dfdd702ca0ccc517be90f55b1d5464cb26 /gold
parent4cf2ad720078a9f490dd5b5bc8893a926479196e (diff)
downloadgdb-f12650bff1a591357c26e0ef6d7be0323f76fdb8.zip
gdb-f12650bff1a591357c26e0ef6d7be0323f76fdb8.tar.gz
gdb-f12650bff1a591357c26e0ef6d7be0323f76fdb8.tar.bz2
Fix incremental linking with rodata merge sections.
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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/layout.cc3
2 files changed, 8 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index e152e1e..bfb7a70 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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.
diff --git a/gold/layout.cc b/gold/layout.cc
index 8563f11..8acfb96 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();