[PATCH] D60250: [llvm-objdump] Allow -dynamic-reloc on ET_EXEC files

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 07:08:03 PDT 2019


MaskRay added a comment.

I think the error message `error: not a dynamic object` is a bit inappropriate. GNU objdump reports the error if it cannot find the dynamic section and the BFD flag `DYNAMIC` (`ET_DYN`) is not set.

  static asymbol **
  slurp_dynamic_symtab (bfd *abfd)
  {
    asymbol **sy = NULL;
    long storage;
  
    storage = bfd_get_dynamic_symtab_upper_bound (abfd);   //// no dynamic section
    if (storage < 0)
      {
        if (!(bfd_get_file_flags (abfd) & DYNAMIC))      //////// not ET_DYN.
  	{
  	  non_fatal (_("%s: not a dynamic object"), bfd_get_filename (abfd));
  	  exit_status = 1;
  	  dynsymcount = 0;
  	  return NULL;
  	}

I think a probably better error message can just say that the `.dynamic` section is missing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60250/new/

https://reviews.llvm.org/D60250





More information about the llvm-commits mailing list