diff options
Diffstat (limited to 'lld/ELF/Target.h')
-rw-r--r-- | lld/ELF/Target.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h index 93f1592..fdc0c20 100644 --- a/lld/ELF/Target.h +++ b/lld/ELF/Target.h @@ -214,6 +214,7 @@ void processArmCmseSymbols(Ctx &); template <class ELFT> uint32_t calcMipsEFlags(Ctx &); uint8_t getMipsFpAbiFlag(Ctx &, InputFile *file, uint8_t oldFlag, uint8_t newFlag); +uint64_t getMipsPageAddr(uint64_t addr); bool isMipsN32Abi(Ctx &, const InputFile &f); bool isMicroMips(Ctx &); bool isMipsR6(Ctx &); @@ -338,21 +339,23 @@ inline uint64_t overwriteULEB128(uint8_t *bufLoc, uint64_t val) { #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #endif #define invokeELFT(f, ...) \ - switch (ctx.arg.ekind) { \ - case lld::elf::ELF32LEKind: \ - f<llvm::object::ELF32LE>(__VA_ARGS__); \ - break; \ - case lld::elf::ELF32BEKind: \ - f<llvm::object::ELF32BE>(__VA_ARGS__); \ - break; \ - case lld::elf::ELF64LEKind: \ - f<llvm::object::ELF64LE>(__VA_ARGS__); \ - break; \ - case lld::elf::ELF64BEKind: \ - f<llvm::object::ELF64BE>(__VA_ARGS__); \ - break; \ - default: \ - llvm_unreachable("unknown ctx.arg.ekind"); \ - } + do { \ + switch (ctx.arg.ekind) { \ + case lld::elf::ELF32LEKind: \ + f<llvm::object::ELF32LE>(__VA_ARGS__); \ + break; \ + case lld::elf::ELF32BEKind: \ + f<llvm::object::ELF32BE>(__VA_ARGS__); \ + break; \ + case lld::elf::ELF64LEKind: \ + f<llvm::object::ELF64LE>(__VA_ARGS__); \ + break; \ + case lld::elf::ELF64BEKind: \ + f<llvm::object::ELF64BE>(__VA_ARGS__); \ + break; \ + default: \ + llvm_unreachable("unknown ctx.arg.ekind"); \ + } \ + } while (0) #endif |