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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 09:05:09 PDT 2020


MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

llvm-objdump has some features (-R) which overlap with llvm-readelf (-r). For this one, there are a number of differences:

- No `OFFSET           TYPE              VALUE` line.
- No attempt to align `VALUE` columns.
- Does not test PT_DYNAMIC. `objdump -R` works without SHT_DYNAMIC. There are a number of changes in llvm-readobj in this area. I don't know how many we want to port/duplicate in llvm-objdump.

This patch is moving toward the right direction and I don't expect it to address the above points, but one unrelated change should be removed and the tests can be organized in a better way...

Requesting changes as I guess the author may be inactive in LLVM...



================
Comment at: llvm/include/llvm/Object/ELFObjectFile.h:774
   for (const Elf_Shdr &Sec : *SectionsOrErr) {
-    if (is_contained(Offsets, Sec.sh_offset))
+    if (is_contained(Offsets, Sec.sh_addr))
       Res.emplace_back(toDRI(&Sec), this);
----------------
Seem unrelated.


================
Comment at: llvm/test/tools/llvm-objdump/dynamic-reloc-no-dynamic.test:3
+#
+# RUN: yaml2obj %s > %t
+# RUN: not llvm-objdump -R %t 2>&1 | FileCheck %s
----------------
-o

Perhaps we should just port some `test/tools/llvm-readobj/ELF/dynamic-*` here if we are going to improve llvm-objdump -R.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60250





More information about the llvm-commits mailing list