Res |= BasicSymbolRef::SF_Undefined;
Res |= BasicSymbolRef::SF_Global;
break;
- case RecordStreamer::GlobalWeak:
+ case RecordStreamer::DefinedWeak:
Res |= BasicSymbolRef::SF_Weak;
Res |= BasicSymbolRef::SF_Global;
break;
+ case RecordStreamer::UndefinedWeak:
+ Res |= BasicSymbolRef::SF_Weak;
+ Res |= BasicSymbolRef::SF_Undefined;
}
AsmUndefinedRefs(Key, BasicSymbolRef::Flags(Res));
}
case Used:
S = Defined;
break;
- case GlobalWeak:
+ case DefinedWeak:
break;
+ case UndefinedWeak:
+ S = DefinedWeak;
}
}
switch (S) {
case DefinedGlobal:
case Defined:
- S = (Attribute == MCSA_Weak) ? GlobalWeak : DefinedGlobal;
+ S = (Attribute == MCSA_Weak) ? DefinedWeak : DefinedGlobal;
break;
case NeverSeen:
case Global:
case Used:
- S = (Attribute == MCSA_Weak) ? GlobalWeak : Global;
+ S = (Attribute == MCSA_Weak) ? UndefinedWeak : Global;
break;
- case GlobalWeak:
+ case UndefinedWeak:
+ case DefinedWeak:
break;
}
}
case DefinedGlobal:
case Defined:
case Global:
- case GlobalWeak:
+ case DefinedWeak:
+ case UndefinedWeak:
break;
case NeverSeen:
namespace llvm {
class RecordStreamer : public MCStreamer {
public:
- enum State { NeverSeen, Global, GlobalWeak, Defined, DefinedGlobal, Used };
+ enum State { NeverSeen, Global, Defined, DefinedGlobal, DefinedWeak, Used,
+ UndefinedWeak};
private:
StringMap<State> Symbols;
; RUN: llvm-as %s -o=%t1
; RUN: llvm-nm %t1 | FileCheck %s
+; Check that __libc_blah is reported as defined weak.
; CHECK: W __libc_blah
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
module asm ".weak __libc_blah"
module asm ".equ __libc_blah, blah"
+module asm ".globl blah"
+module asm "blah: ret"
--- /dev/null
+; RUN: llvm-as %s -o=%t1
+; RUN: llvm-nm %t1 | FileCheck %s
+
+; Check that patatino is reported as undefined weak.
+; CHECK: w patatino
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-freebsd11.0"
+
+module asm ".weak patatino"