[PATCH] D59989: [llvm-objcopy]Allow llvm-objcopy to be used on an ELF file with no section headers

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 07:59:24 PDT 2019


grimar added inline comments.


================
Comment at: tools/llvm-objcopy/ELF/Object.cpp:1573
+    return Obj.SHOffset;
+  size_t ShdrCount = size(Obj.sections()) + 1; // Includes null shdr.
+  return Obj.SHOffset + ShdrCount * sizeof(Elf_Shdr);
----------------
jhenderson wrote:
> grimar wrote:
> > `size` is a bit strange helper. I do not think it is common to use it instead of `.size()` call
> > for a container in LLVM..
> > I see it is not your initial code, but since you're changing it, what do you think about not using it here at all?
> The underlying container doesn't currently have a `size()` method. There are quite a few places in this file that seem to use this helper, so perhaps it should be a different change?
Oh, I thought it has. I have no objections then.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59989





More information about the llvm-commits mailing list