[PATCH] D140202: [lld][ARM][2/3]Big Endian support - Word invariant support

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 11:10:55 PDT 2023

peter.smith added a comment.

This looks correct, although I think there are a few places where we can simplify the code to remove the explicit endianness.

Comment at: lld/ELF/SyntheticSections.cpp:3545
   const uint8_t cantUnwindData[8] = {0, 0, 0, 0,  // PREL31 to target
                                      1, 0, 0, 0}; // EXIDX_CANTUNWIND
I think we can simplify the function by replacing cantUnwindData with a comment
// A linker generated CANTUNWIND entry is made up of two words
// 0x0 with R_ARM_PREL31 relocation to target.
// 0x1
We can then replace `read32le(cantUnwindData+0)` with 0x0 and `read32le(cantUnwindData+4)` with 0x1 in the two places it is used.

Comment at: lld/ELF/SyntheticSections.cpp:3568
   // Write Sentinel.
+  write32(buf + offset + 0, read32le(cantUnwindData+0));
Suggest making this // Write Sentinel CANTUNWIND entry.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list