forked from OSchip/llvm-project
parent
f1ce4cf1f1
commit
148445ef98
|
@ -450,10 +450,12 @@ void BitcodeFile::parse() {
|
|||
Sym.printName(OS);
|
||||
StringRef NameRef = Saver.save(StringRef(Name));
|
||||
SymbolBody *Body;
|
||||
if (Sym.getFlags() & BasicSymbolRef::SF_Undefined)
|
||||
uint32_t Flags = Sym.getFlags();
|
||||
if (Flags & BasicSymbolRef::SF_Undefined)
|
||||
Body = new (Alloc) Undefined(NameRef, false, STV_DEFAULT, false);
|
||||
else
|
||||
Body = new (Alloc) DefinedBitcode(NameRef);
|
||||
Body =
|
||||
new (Alloc) DefinedBitcode(NameRef, Flags & BasicSymbolRef::SF_Weak);
|
||||
SymbolBodies.push_back(Body);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,8 +161,8 @@ Defined::Defined(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,
|
|||
bool IsTls, bool IsFunction)
|
||||
: SymbolBody(K, Name, IsWeak, Visibility, IsTls, IsFunction) {}
|
||||
|
||||
DefinedBitcode::DefinedBitcode(StringRef Name)
|
||||
: Defined(DefinedBitcodeKind, Name, false, STV_DEFAULT, false, false) {}
|
||||
DefinedBitcode::DefinedBitcode(StringRef Name, bool IsWeak)
|
||||
: Defined(DefinedBitcodeKind, Name, IsWeak, STV_DEFAULT, false, false) {}
|
||||
|
||||
bool DefinedBitcode::classof(const SymbolBody *S) {
|
||||
return S->kind() == DefinedBitcodeKind;
|
||||
|
|
|
@ -190,7 +190,7 @@ public:
|
|||
|
||||
class DefinedBitcode : public Defined {
|
||||
public:
|
||||
DefinedBitcode(StringRef Name);
|
||||
DefinedBitcode(StringRef Name, bool IsWeak);
|
||||
static bool classof(const SymbolBody *S);
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
; REQUIRES: x86
|
||||
; RUN: llvm-as %s -o %t.o
|
||||
; RUN: ld.lld -m elf_x86_64 %t.o %t.o -o %t.so -shared
|
||||
; RUN: llvm-readobj -t %t.so | FileCheck %s
|
||||
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
|
||||
define weak void @f() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: Name: f
|
||||
; CHECK-NEXT: Value: 0x1000
|
||||
; CHECK-NEXT: Size: 1
|
||||
; CHECK-NEXT: Binding: Weak
|
Loading…
Reference in New Issue