[lld] [llvm] [Object][Wasm] Use file offset for section addresses in linked wasm files (PR #80529)
Derek Schuff via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 11:24:46 PST 2024
================
@@ -1366,8 +1375,9 @@ static SymbolInfoTy createDummySymbolInfo(const ObjectFile &Obj,
uint8_t Type) {
if (Obj.isXCOFF() && (SymbolDescription || TracebackTable))
return SymbolInfoTy(std::nullopt, Addr, Name, std::nullopt, false);
- else
- return SymbolInfoTy(Addr, Name, Type);
+ if (Obj.isWasm())
+ return SymbolInfoTy(Addr, Name, wasm::WASM_SYMBOL_TYPE_SECTION);
----------------
dschuff wrote:
Yeah this only has one [callsite](https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-objdump/llvm-objdump.cpp#L1841) which just passes an ELF symbol type. so we could just as easily put this same logic there instead. I just decided to put it here because there was already a check for COFF. This file is full of this kind of confusion , where some places make ELF-specific assumptions and others have switches like this.
https://github.com/llvm/llvm-project/pull/80529
More information about the llvm-commits
mailing list