This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Gold Patch] Handle DW_AT_GNU_pubnames in DW_FORM_flag_present

(I know you're about to send me a revised patch, but here are a few
nits I found...)


   // If we don't have relocations, shndx will be 0, and
   // we'll have to hunt for the .debug_pubnames/pubtypes section.
-  if (shndx == 0)
+  const char* name = (this->is_pubtypes_
+                      ? ".debug_pubtypes"
+                      : ".debug_pubnames");
+  for (unsigned int i = 1; i < object->shnum(); ++i)

Please delete "If we don't have relocations, ... and". We're not using
a relocated offset to find this section anymore, so we have to find
the section by name.

+  // Make sure we have actually read the section.
+  gold_assert(this->buffer_ != NULL);
   // Correct the offset.  For incremental update links, we have a
   // relocated offset that is relative to the output section, but
   // here we need an offset relative to the input section.

Move the blank line after the assert.

   // Read the unit_length field.
-  uint32_t unit_length = this->dwinfo_->read_from_pointer<32>(pinfo);
+  off_t unit_length = this->dwinfo_->read_from_pointer<32>(pinfo);
   pinfo += 4;
   if (unit_length == 0xffffffff)
       unit_length = this->dwinfo_->read_from_pointer<64>(pinfo);
+      this->unit_length_ = unit_length + 12;

It looks like unit_length should really be uint64_t (as is

   if (version != 2)
     return false;

+  this->reloc_mapper_->get_reloc_target(pinfo - this->buffer_,
+                                        &this->cu_offset_);
   // Skip the debug_info_offset and debug_info_size fields.

Extra blank line.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]