return Header;
}
-void WasmObjectFile::moveSymbolNext(DataRefImpl &Symb) const { Symb.d.a++; }
+void WasmObjectFile::moveSymbolNext(DataRefImpl &Symb) const { Symb.d.b++; }
uint32_t WasmObjectFile::getSymbolFlags(DataRefImpl Symb) const {
uint32_t Result = SymbolRef::SF_None;
basic_symbol_iterator WasmObjectFile::symbol_begin() const {
DataRefImpl Ref;
- Ref.d.a = 0;
+ Ref.d.a = 1; // Arbitrary non-zero value so that Ref.p is non-null
+ Ref.d.b = 0; // Symbol index
return BasicSymbolRef(Ref, this);
}
basic_symbol_iterator WasmObjectFile::symbol_end() const {
DataRefImpl Ref;
- Ref.d.a = Symbols.size();
+ Ref.d.a = 1; // Arbitrary non-zero value so that Ref.p is non-null
+ Ref.d.b = Symbols.size(); // Symbol index
return BasicSymbolRef(Ref, this);
}
const WasmSymbol &WasmObjectFile::getWasmSymbol(const DataRefImpl &Symb) const {
- return Symbols[Symb.d.a];
+ return Symbols[Symb.d.b];
}
const WasmSymbol &WasmObjectFile::getWasmSymbol(const SymbolRef &Symb) const {
if not 'X86' in config.root.targets:
config.unsupported = True
-config.suffixes = ['.s', '.test', '.yaml']
+config.suffixes = ['.ll', '.s', '.test', '.yaml']
--- /dev/null
+; RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown -o %t.o %s
+; RUN: llvm-nm --extern-only %t.o | FileCheck %s
+
+; Verity that hidden symbols are listed even when --extern-only is passed
+
+define hidden i32 @foo() {
+entry:
+ ret i32 42
+}
+
+define i32 @bar() {
+entry:
+ ret i32 43
+}
+
+define internal i32 @baz() {
+entry:
+ ret i32 44
+}
+
+; CHECK: 00000006 T bar
+; CHECK-NOT: baz
+; CHECK: 00000001 T foo