forked from OSchip/llvm-project
[elf2] Relocate against undefined weak symbols.
llvm-svn: 248056
This commit is contained in:
parent
9077e9f8f2
commit
9779535c5d
|
@ -750,7 +750,9 @@ void OutputSection<ELFT>::relocate(
|
|||
Type = R_X86_64_PC32;
|
||||
break;
|
||||
case SymbolBody::UndefinedKind:
|
||||
continue;
|
||||
assert(Body->isWeak() && "Undefined symbol reached writer");
|
||||
SymVA = 0;
|
||||
break;
|
||||
case SymbolBody::LazyKind:
|
||||
llvm_unreachable("Lazy symbol reached writer");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
||||
// RUN: lld -flavor gnu2 %t -o %tout
|
||||
// RUN: llvm-objdump -d %tout | FileCheck %s
|
||||
// REQUIRES: x86
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
movl $1, sym1(%rip)
|
||||
|
||||
.weak sym1
|
||||
|
||||
// CHECK: movl $1, -69642(%rip)
|
Loading…
Reference in New Issue