[PATCH] D15575: [ELF] Allow target to configure ELF header flags in the output file

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 10:53:07 PST 2015


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:1257-1261
@@ -1256,2 +1256,7 @@
   GotHeaderEntriesNum = 2;
+  // FIXME: In fact ELF flags depends on ELF flags of input object files
+  // and selected emulation.
+  ELFFlags = EF_MIPS_ABI_O32 | EF_MIPS_CPIC | EF_MIPS_ARCH_32R2;
+  if (Config->Shared)
+    ELFFlags |= EF_MIPS_PIC;
 }
----------------
ruiu wrote:
> atanasyan wrote:
> > ruiu wrote:
> > > Instead of assigning a value to ELFFlags member, can you move this code to getELFFlags and return a new value without assignment?
> > Do you suggest to make the `getELFFlags` virtual or put `if (Config->EMachine == EM_MIPS)` into it?
> I have no strong preference, but maybe virtual?
On second thought, this doesn't seem to have to belong this file. This can be written in Writer.cpp as a non-member function. Maybe that's better?


Repository:
  rL LLVM

http://reviews.llvm.org/D15575





More information about the llvm-commits mailing list