The trap value used by BOLT was assumed to be single-byte instruction. It made some functions unaligned on AArch64(e.g exceptions-instrumentation test with AArch64 instrumentation) and caused emission failures. Fix that by changing fill value to target-specific StringRef. Since AArch64 instrumentation is not merged yet, here i use mark-funcs option to trigger the bug and provide a testcase.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM. Thanks!
bolt/lib/Core/BinaryEmitter.cpp | ||
---|---|---|
383 | Note: I'm guessing this is not accounted for in LongJmp.cpp.. this will be one source of mismatched layout between what LongJmp thinks the layout will be and what the layout really is, leading to missing trampolines in some cases. This is a point in favor of maybe trying to insert the trampolines in JITLink maybe, as syncing LongJmp's understanding of the layout with what actually is happening in BOLT's emitter is a hard task. |
Note: I'm guessing this is not accounted for in LongJmp.cpp.. this will be one source of mismatched layout between what LongJmp thinks the layout will be and what the layout really is, leading to missing trampolines in some cases.
This is a point in favor of maybe trying to insert the trampolines in JITLink maybe, as syncing LongJmp's understanding of the layout with what actually is happening in BOLT's emitter is a hard task.