llvm-project/llvm/lib/Target/SystemZ/SystemZTargetObjectFile.cpp
Ulrich Weigand a8cb9db5f5
[SystemZ] Use proper relocation for TLS variable debug info (#83975)
Debug info refering to a TLS variable via DW_OP_GNU_push_tls_address
needs to use a R_390_TLS_LDO64 relocation instead of R_390_64.

Fixed by adding a SystemZELFTargetObjectFile override class and proving
a getDebugThreadLocalSymbol implementation.
2024-03-05 17:48:06 +01:00

20 lines
712 B
C++

//===-- SystemZTargetObjectFile.cpp - SystemZ Object Info -----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "SystemZTargetObjectFile.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
const MCExpr *SystemZELFTargetObjectFile::getDebugThreadLocalSymbol(
const MCSymbol *Sym) const {
return MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_DTPOFF, getContext());
}