forked from OSchip/llvm-project
Don't apply a relocation if we create a dynamic reloc.
With RELA that is just wasteful, with REL the relocation gets applied twice. llvm-svn: 248795
This commit is contained in:
parent
5edd83de91
commit
be901e2dbc
|
@ -60,6 +60,8 @@ void InputSection<ELFT>::relocate(
|
|||
} else if (Target->relocPointsToGot(Type)) {
|
||||
SymVA = GotSec.getVA();
|
||||
Type = Target->getPCRelReloc();
|
||||
} else if (isa<SharedSymbol<ELFT>>(Body)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,3 +57,9 @@ R_386_GOTPC:
|
|||
// CHECK: Disassembly of section .R_386_GOTPC:
|
||||
// CHECK-NEXT: R_386_GOTPC:
|
||||
// CHECK-NEXT: 11014: {{.*}} movl $16364, %eax
|
||||
|
||||
.section .dynamic_reloc, "ax",@progbits
|
||||
call bar+4
|
||||
// CHECK: Disassembly of section .dynamic_reloc:
|
||||
// CHECK-NEXT: .dynamic_reloc:
|
||||
// CHECK-NEXT: 11019: e8 00 00 00 00 calll 0
|
||||
|
|
Loading…
Reference in New Issue