mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
fad0fd9a71
Summary: LLVM defaults to the newer .init_array/.fini_array scheme for static constructors rather than the less desirable .ctors/.dtors (the UseCtors flag defaults to false). This wasn't being respected in the RISC-V backend because it fails to call TargetLoweringObjectFileELF::InitializeELF with the the appropriate flag for UseInitArray. This patch fixes this by implementing RISCVELFTargetObjectFile and overriding its Initialize method to call InitializeELF(TM.Options.UseInitArray). Reviewers: asb, apazos Reviewed By: asb Subscribers: mgorny, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, llvm-commits Differential Revision: https://reviews.llvm.org/D44750 llvm-svn: 328433
26 lines
777 B
C++
26 lines
777 B
C++
//===-- RISCVTargetObjectFile.h - RISCV Object Info -*- C++ ---------*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETOBJECTFILE_H
|
|
#define LLVM_LIB_TARGET_RISCV_RISCVTARGETOBJECTFILE_H
|
|
|
|
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
|
|
|
namespace llvm {
|
|
class RISCVTargetMachine;
|
|
|
|
/// This implementation is used for RISCV ELF targets.
|
|
class RISCVELFTargetObjectFile : public TargetLoweringObjectFileELF {
|
|
void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif
|