llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Out of range R_X86_64_REX_GOTPCRELX relocation for __preinit_array_start/end with linker script and high image base

Open nga888 opened this issue 5 years ago • 1 comments

Bugzilla Link 52534
Resolution FIXED
Resolved on Nov 19, 2021 03:52
Version unspecified
OS Windows NT
CC @smithp35

Extended Description

Test to reproduce issue:

REQUIRES: x86

RUN: split-file %s %t

RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/t.s -o %t.o

RUN: ld.lld --script %t/t.script %t.o -o /dev/null --image-base=0x80000000

#--- t.s .global _start _start: movq __preinit_array_start@GOTPCREL(%rip),%rax

#--- t.script SECTIONS { .text : { *(.text); } .preinit_array : { *(.preinit_array); } }

nga888 avatar Nov 17 '21 15:11 nga888

Fixed in commit https://github.com/llvm/llvm-project/commit/47eb3f155f9e7b2670b8e0f8a85c64f31ea39fa4.

nga888 avatar Nov 19 '21 11:11 nga888