[PATCH] D153262: Add named section flag "large" to objcopy

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 09:20:39 PDT 2023


rnk added inline comments.


================
Comment at: llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp:86
+  if (AllFlags & SectionFlag::SecLarge)
+    NewFlags |= ELF::SHF_X86_64_LARGE;
   return NewFlags;
----------------
I think the thing to do is to:
- Pass in the elf machine
- Make NewFlags an output parameter (out parameters seem more consistent with local code than ErrorOr)
- Return an Error instead
- While handling the generic SecLarge flag, check the ELF machine, produce an error for non x86_64 machine values
- Propagate that up out of setSectionFlagsAndType, whose caller can return Error


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

https://reviews.llvm.org/D153262



More information about the llvm-commits mailing list