[PATCH] D57365: [llvm-readobj] Add a flag to dump just the section-to-segment mapping.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 13:25:23 PST 2019


mattd added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/gnu-phdrs.test:21-24
+RUN: llvm-readelf -section-mapping %p/Inputs/phdrs-elf.exe-x86_64 \
+RUN:   | FileCheck %s -check-prefix ELF64-MAPPING
+RUN: llvm-readelf -section-mapping %p/Inputs/phdrs-elf.exe-x86_64 \
+RUN:   | FileCheck %s -check-prefix ELF64-JUSTMAPPING
----------------
jhenderson wrote:
> You can combine these two into a single test, by using `--implicit-check-not` which I'd forgotten about until now. Just do the following:
> 
> ```
> RUN: llvm-readelf -section-mapping %p/Inputs/phdrs-elf.exe-x86_64 \
> RUN:   --implicit-check-not="Program Headers:" | FileCheck %s -check-prefix ELF64-MAPPING
> ```
Ah,interesting, I was unfamiliar with this option!  Thanks for the tip.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4540-4541
+    printProgramHeaders(Obj);
+  if (PrintSectionMapping == cl::BOU_TRUE)
+    printSectionMapping(Obj);
+}
----------------
jhenderson wrote:
> Given we don't currently support section mapping in LLVM style, does it make sense to have this here?
We don't need it, I anticipate we will eventually provide a definition to `LLVMStyle<ELFT>::printSectionMapping`.  To me, the function feels incomplete if we take a parameter and do nothing with it.  Additionally, I fear the annoyance of compiler warning messages about unused formal parameters.... if anyone is building this with -Wunused-parameter.  


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

https://reviews.llvm.org/D57365





More information about the llvm-commits mailing list