[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:17:53 PDT 2023
peter.smith added inline comments.
================
Comment at: lld/ELF/SyntheticSections.cpp:3445
+static bool isDuplicateArmExidxSec(InputSection *prev, InputSection *cur) {
+ switch (config->ekind) {
----------------
Phab lost my previous comment that I had spent ages on. Sigh...
I think that we can rewrite this so that we don't have to use explicit endianness. Instead of using getDataAs() we use content().getData() and read32().
For example (untested and will need comments)
```
uint32_t prevUnwind = 1;
if (prev)
prevUnwind = read32(prev->getContent().getData() + prev->size - 4);
if (isExtabRef(prevUnwind))
return false;
...
if (cur == nullptr)
return prevUnwind == 1;
for(uint32_t offset = 4; offset < size; offset += 8) {
uint32_t curUnwind = read32(getContent().getData() + offset);
if (isExtabRef(curUnwind) || curUnwind != prevUnwind)
return false;
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140202/new/
https://reviews.llvm.org/D140202
More information about the llvm-commits
mailing list