forked from OSchip/llvm-project
Fix a crash.
This is a constructed testcase I noticed while working on another patch. llvm-svn: 319874
This commit is contained in:
parent
146a9c3e51
commit
a834b529c3
|
|
@ -601,8 +601,8 @@ static RelExpr adjustExpr(Symbol &Sym, RelExpr Expr, RelType Type,
|
|||
|
||||
if (Sym.isObject()) {
|
||||
// Produce a copy relocation.
|
||||
auto *B = cast<SharedSymbol>(&Sym);
|
||||
if (!B->CopyRelSec) {
|
||||
auto *B = dyn_cast<SharedSymbol>(&Sym);
|
||||
if (B && !B->CopyRelSec) {
|
||||
if (Config->ZNocopyreloc)
|
||||
error("unresolvable relocation " + toString(Type) +
|
||||
" against symbol '" + toString(*B) +
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
# REQUIRES: x86
|
||||
|
||||
# We used to crash on this, check that we don't
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
# RUN: ld.lld %t.o -o %t -pie --unresolved-symbols=ignore-all
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
.quad foo - .
|
||||
.type foo, @object
|
||||
Loading…
Reference in New Issue