https://sourceware.org/bugzilla/show_bug.cgi?id=17556

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
This avoids crash:

diff --git a/gold/object.cc b/gold/object.cc
index 689448f50c..9051438e73 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -1644,6 +1644,13 @@ Sized_relobj_file<size,
big_endian>::do_layout(Symbol_table* symtab,
         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)
       {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to