* Makefile.am ($(srcdir)/ia64-asmtab.c): Remove line continuation.
[deliverable/binutils-gdb.git] / gold / output.cc
index 6ec4aef6601b02e02d32e6f38986b8daf8426a56..145fca159df5f00e0fb4bc7c3e6af3c592b9d5ac 100644 (file)
@@ -37,6 +37,7 @@
 #include "symtab.h"
 #include "reloc.h"
 #include "merge.h"
+#include "descriptors.h"
 #include "output.h"
 
 // Some BSD systems still use MAP_ANON instead of MAP_ANONYMOUS
@@ -1819,9 +1820,11 @@ Output_section::add_input_section(Sized_relobj<size, big_endian>* object,
 
   // If this is a SHF_MERGE section, we pass all the input sections to
   // a Output_data_merge.  We don't try to handle relocations for such
-  // a section.
+  // a section.  We don't try to handle empty merge sections--they
+  // mess up the mappings, and are useless anyhow.
   if ((sh_flags & elfcpp::SHF_MERGE) != 0
-      && reloc_shndx == 0)
+      && reloc_shndx == 0
+      && shdr.get_sh_size() > 0)
     {
       if (this->add_merge_input_section(object, shndx, sh_flags,
                                        entsize, addralign))
@@ -3319,7 +3322,8 @@ Output_file::open(off_t file_size)
            unlink_if_ordinary(this->name_);
 
          int mode = parameters->options().relocatable() ? 0666 : 0777;
-         int o = ::open(this->name_, O_RDWR | O_CREAT | O_TRUNC, mode);
+         int o = open_descriptor(-1, this->name_, O_RDWR | O_CREAT | O_TRUNC,
+                                 mode);
          if (o < 0)
            gold_fatal(_("%s: open: %s"), this->name_, strerror(errno));
          this->o_ = o;
This page took 0.025659 seconds and 4 git commands to generate.