[PATCH] D53204: [ELF] [HEXAGON] Let input determine ELF header e_flags
Sid Manning via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 12 09:45:34 PDT 2018
sidneym created this revision.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.
Use the input file list to determine e_flags.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D53204
Files:
ELF/Arch/Hexagon.cpp
Index: ELF/Arch/Hexagon.cpp
===================================================================
--- ELF/Arch/Hexagon.cpp
+++ ELF/Arch/Hexagon.cpp
@@ -55,8 +55,23 @@
NoneRel = R_HEX_NONE;
}
-// Support V60 only at the moment.
-uint32_t Hexagon::calcEFlags() const { return 0x60; }
+static uint32_t getEFlags(InputFile *F) {
+ return cast<ObjFile<ELF32LE>>(F)->getObj().getHeader()->e_flags;
+}
+
+uint32_t Hexagon::calcEFlags() const {
+ assert(!ObjectFiles.empty());
+
+ // The architecture revision must always be equal to or greater than
+ // greatest revision in the list of inputs.
+ uint32_t Target = 0;
+ for (InputFile *F : ObjectFiles) {
+ uint32_t EFlags = getEFlags(F);
+ if (EFlags > Target)
+ Target = EFlags;
+ }
+ return Target;
+}
static uint32_t applyMask(uint32_t Mask, uint32_t Data) {
uint32_t Result = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53204.169437.patch
Type: text/x-patch
Size: 856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181012/fb1bdd62/attachment.bin>
More information about the llvm-commits
mailing list