forked from OSchip/llvm-project
Don't confuse input and output section offsets.
llvm-svn: 273006
This commit is contained in:
parent
7b998853ee
commit
678844e68a
|
@ -511,13 +511,13 @@ static void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
|
|||
uint32_t Type = RI.getType(Config->Mips64EL);
|
||||
|
||||
RelExpr Expr = Target->getRelExpr(Type, Body);
|
||||
uintX_t Offset = C.getOffset(RI.r_offset);
|
||||
if (Offset == (uintX_t)-1)
|
||||
bool Preemptible = isPreemptible(Body, Type);
|
||||
Expr = adjustExpr(File, Body, IsWrite, Expr, Type, Buf + RI.r_offset);
|
||||
if (HasError)
|
||||
continue;
|
||||
|
||||
bool Preemptible = isPreemptible(Body, Type);
|
||||
Expr = adjustExpr(File, Body, IsWrite, Expr, Type, Buf + Offset);
|
||||
if (HasError)
|
||||
uintX_t Offset = C.getOffset(RI.r_offset);
|
||||
if (Offset == (uintX_t)-1)
|
||||
continue;
|
||||
|
||||
// This relocation does not require got entry, but it is relative to got and
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
.global foo
|
||||
.hidden foo
|
||||
foo:
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
|
@ -0,0 +1,13 @@
|
|||
// REQUIRES: x86
|
||||
// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux %s \
|
||||
// RUN: -o %t.o
|
||||
// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux \
|
||||
// RUN: %p/Inputs/x86-64-relax-offset.s -o %t2.o
|
||||
// RUN: ld.lld %t2.o %t.o -o %t.so -shared
|
||||
// RUN: llvm-objdump -d %t.so | FileCheck %s
|
||||
|
||||
mov foo@gotpcrel(%rip), %rax
|
||||
nop
|
||||
|
||||
// CHECK: 1004: {{.*}} leaq -11(%rip), %rax
|
||||
// CHECK-NEXT: 100b: {{.*}} nop
|
Loading…
Reference in New Issue