This is the mail archive of the binutils@sourceware.org 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]

[patch] Parse NT_GNU_BUILD_ID into elf_obj_tdata->build_id*


Hi,

so far BFD was parsing notes only for core files.  GDB should now parse the
build-id notes even from executables/libraries.  Excerpt from the GDB patch
using this parsed build-id info is below.


Regards,
Jan


static struct build_id *
build_id_bfd_shdr_get (bfd *abfd)
{
  struct build_id *retval;

  if (!bfd_check_format (abfd, bfd_object)
      || bfd_get_flavour (abfd) != bfd_target_elf_flavour
      || elf_tdata (abfd)->build_id == NULL)
    return NULL;

  retval = xmalloc (sizeof *retval - 1 + elf_tdata (abfd)->build_id_size);
  retval->size = elf_tdata (abfd)->build_id_size;
  memcpy (retval->data, elf_tdata (abfd)->build_id, retval->size);

  return retval;
}

Attachment: bfd-buildid-fetch.patch
Description: Text document


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