2024-02-04 20:41:09 +08:00
|
|
|
diff -rupN --no-dereference binutils-2.34/gold/layout.cc binutils-2.34-new/gold/layout.cc
|
|
|
|
|
--- binutils-2.34/gold/layout.cc 2020-01-18 14:55:48.000000000 +0100
|
|
|
|
|
+++ binutils-2.34-new/gold/layout.cc 2020-12-18 02:57:21.401031221 +0100
|
|
|
|
|
@@ -869,6 +869,7 @@ Layout::get_output_section(const char* n
|
2020-10-08 17:29:50 +08:00
|
|
|
&& (same_name->flags() & elfcpp::SHF_TLS) == 0)
|
|
|
|
|
os = same_name;
|
|
|
|
|
}
|
|
|
|
|
+#if 0 /* BZ 1722715, PR 17556. */
|
|
|
|
|
else if ((flags & elfcpp::SHF_TLS) == 0)
|
|
|
|
|
{
|
|
|
|
|
elfcpp::Elf_Xword zero_flags = 0;
|
2024-02-04 20:41:09 +08:00
|
|
|
@@ -879,6 +880,7 @@ Layout::get_output_section(const char* n
|
2020-10-08 17:29:50 +08:00
|
|
|
if (p != this->section_name_map_.end())
|
|
|
|
|
os = p->second;
|
|
|
|
|
}
|
|
|
|
|
+#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (os == NULL)
|
2024-02-04 20:41:09 +08:00
|
|
|
diff -rupN --no-dereference binutils-2.34/gold/object.cc binutils-2.34-new/gold/object.cc
|
|
|
|
|
--- binutils-2.34/gold/object.cc 2020-01-18 14:55:48.000000000 +0100
|
|
|
|
|
+++ binutils-2.34-new/gold/object.cc 2020-12-18 02:57:21.402031218 +0100
|
|
|
|
|
@@ -1656,6 +1656,13 @@ Sized_relobj_file<size, big_endian>::do_
|
2020-10-08 17:29:50 +08:00
|
|
|
omit[i] = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Skip empty sections without flags.
|
|
|
|
|
+ if (!(shdr.get_sh_flags() & ~elfcpp::SHF_GROUP)
|
|
|
|
|
+ && !shdr.get_sh_size())
|
|
|
|
|
+ {
|
|
|
|
|
+ omit[i] = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
bool discard = omit[i];
|
|
|
|
|
if (!discard)
|
|
|
|
|
{
|