[PATCH] D57277: [COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 15:14:53 PST 2019


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64AsmPrinter.cpp:583
   const TargetLoweringObjectFile &TLOF = getObjFileLowering();
-  MCSection *ReadOnlySec = TLOF.getSectionForJumpTable(MF->getFunction(), TM);
-  OutStreamer->SwitchSection(ReadOnlySec);
+  bool JTInDiffSection = !TLOF.shouldPutJumpTableInFunctionSection(
+      MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32,
----------------
TomTan wrote:
> efriedma wrote:
> > I'm a little concerned that this is changing the behavior in more cases than you expect.  Do you have any idea if you're changing the behavior for MachO targets?
> Yes, MachO target will also be changed. This is conservative change and should not break there. Or do you suggest checking Windows target here for JTInDiffSection?
I'd rather not change the MachO behavior.  (Putting it into the text section is probably fine for normal binaries, but it could break more exotic execute-only environments.)

Checking for Windows explicitly is probably the simplest; this is target-specific code anyway.  Or I guess you could write a MachO implementation of shouldPutJumpTableInFunctionSection, but I'm not sure what that should look like off the top of my head.


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

https://reviews.llvm.org/D57277





More information about the llvm-commits mailing list