Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/tools/llvm-nm/llvm-nm.cpp | ||
---|---|---|
1136 | Place the new logic inside getSymbolNMTypeChar will be more complex. For both global and local symbols, the key is the lower case i... |
llvm/tools/llvm-nm/llvm-nm.cpp | ||
---|---|---|
1136 | Ok, that behavior makes sence I think. Also, would it be better to do the following? else if (WasmObjectFile *Wasm = dyn_cast<WasmObjectFile>(&Obj)) Ret = getSymbolNMTypeChar(*Wasm, I); else if (ELFObjectFileBase *ELF = dyn_cast<ELFObjectFileBase>(&Obj)) { ... } else llvm_unreachable(...); (for me it wasn't obvious that is is OK to use elf_symbol_iterator(I) before |
I guess this isn't a real-world use case, but did you consider testing the interaction between STB_GNU_UNIQUE and STT_GNU_IFUNC? For all other types, the unique binding trumped the type, so seeing it different is a little odd.
binutils-gdb/bfd/syms.c:bfd_decode_symclass
if (symbol->flags & BSF_GNU_INDIRECT_FUNCTION) return 'i'; if (symbol->flags & BSF_WEAK) { /* If weak, determine if it's specifically an object or non-object weak. */ if (symbol->flags & BSF_OBJECT) return 'V'; else return 'W'; } if (symbol->flags & BSF_GNU_UNIQUE) return 'u';
Our rule matches GNU nm.
With regard to the interaction, STB_GNU_UNIQUE describes a property of a data symbol, while STT_GNU_IFUNC describes a property of a function symbol. So they cannot be mixed.
Add a file comment?