Fangrui Song 83cec143c7 [clang] Change CodeGenOptions::RelaxELFRelocations/assembler defaults to match MC default
MC default was flipped in 2016.
CMake ENABLE_X86_RELAX_RELOCATIONS defaults to on in 2020 (c41a18cf61790fc898dcda1055c3efbf442c14c0).
It makes sense for the CodeGenOptions::RelaxELFRelocations to match, so
that most -cc1/-cc1as command lines won't have this option.

This also fixes a minor issue: -fno-plt -S will now use GOT for
__tls_get_addr calls, matching -fno-plt -c.
2022-12-31 22:24:37 -08:00

11 lines
254 B
C

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj %s -mrelocation-model pic -o %t
// RUN: llvm-readobj -r %t | FileCheck %s
// CHECK: R_X86_64_REX_GOTPCRELX foo
extern int foo;
int *f(void) {
return &foo;
}