[PATCH] D122097: [BOLT] AArch64: Emit text objects

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 16:45:43 PDT 2022


yota9 added inline comments.


================
Comment at: bolt/lib/Passes/Aligner.cpp:177
+    // to at least 8 bytes.
+    if (!BF.size() && BF.hasIslandsInfo()) {
+      const uint16_t Alignment = BF.getConstantIslandAlignment();
----------------
rafauler wrote:
> Is this in sync with LongJmp?
Sure, it is part of the previous commit https://github.com/llvm/llvm-project/commit/af9bdcfc46ef73179797ebd406ab413cd047a8c7


================
Comment at: bolt/test/AArch64/text_data.c:17
+
+__attribute__((section(".text"))) const FooPtr arr[] = {exitOk, NULL};
+
----------------
rafauler wrote:
> Just curious, how would this ever happen naturally (without forcing the compiler to do so)? If this is a synthetic test, it would be good to have a test that shows the real use case of freestanding data in code. But it's fine if it's not possible (e.g. if this is created as part of a non-C compiler implementing some specific runtime).
This is rare case and not a compiler blame. Such things might appear in assembler and examples of such an issues were opened in previous BOLT repos like this: https://github.com/facebookincubator/BOLT/issues/48 . As you said thanks for mapping symbols we can handle such cases a bit better now for aarch64 - by moving the whole object in the newly created text section :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122097



More information about the llvm-commits mailing list