[PATCH] D57146: [llvm-objdump] - Print LMAs when dumping section headers.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 07:41:45 PST 2019


peter.smith added a comment.

I've not got a strong opinion here, for what it is worth:

- The code changes look fine.
- I can see LMA being useful to embedded developers, or tools vendors, given a binary without access to or ability to generate a map file. Would they intuitively look for objdump for that information though? I don't know.
- gnu objdump also gives file offset and flag information which probably have more justification as they can't be derived from other options. If we are looking for output format compatibility then we ought to add those too. I don't think that there is any expectation of that at the moment though.
- If there is a command line option to print the LMA, then there is a risk that a good portion of people won't read far into the help to discover it exists. For that reason I quite like the idea of printing the column only when there are program headers that have different VMA and LMA.



================
Comment at: tools/llvm-objdump/ELFDump.cpp:138
+                              const object::ELFSectionRef &Sec) {
+  auto PhdrOrErr = Obj->program_headers();
+  if (!PhdrOrErr)
----------------
Perhaps PhdrsOrErr or PhdrRangeOrErr? My first thought was what will that call return if it is called on a relocatable object file with no program headers, is it going to give me an error? With PhdrsOrErr it more strongly implies a range.


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

https://reviews.llvm.org/D57146





More information about the llvm-commits mailing list