llvm-project
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
| 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); } }
Fixed in commit https://github.com/llvm/llvm-project/commit/47eb3f155f9e7b2670b8e0f8a85c64f31ea39fa4.