Path: blob/main/contrib/llvm-project/llvm/lib/Target/M68k/M68kTargetObjectFile.cpp
35266 views
//===-- M68kELFTargetObjectFile.cpp - M68k Object Files ---------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file contains definitions for M68k ELF object file lowering.10///11//===----------------------------------------------------------------------===//1213#include "M68kTargetObjectFile.h"1415#include "M68kSubtarget.h"16#include "M68kTargetMachine.h"1718#include "llvm/BinaryFormat/ELF.h"19#include "llvm/IR/DataLayout.h"20#include "llvm/IR/DerivedTypes.h"21#include "llvm/IR/GlobalVariable.h"22#include "llvm/MC/MCContext.h"23#include "llvm/MC/MCSectionELF.h"24#include "llvm/Support/CommandLine.h"25#include "llvm/Target/TargetMachine.h"2627using namespace llvm;2829static cl::opt<unsigned> SSThreshold(30"m68k-ssection-threshold", cl::Hidden,31cl::desc("Small data and bss section threshold size (default=8)"),32cl::init(8));3334void M68kELFTargetObjectFile::Initialize(MCContext &Ctx,35const TargetMachine &TM) {36TargetLoweringObjectFileELF::Initialize(Ctx, TM);37InitializeELF(TM.Options.UseInitArray);3839this->TM = &static_cast<const M68kTargetMachine &>(TM);4041// FIXME do we need `.sdata` and `.sbss` explicitly?42SmallDataSection = getContext().getELFSection(43".sdata", ELF::SHT_PROGBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC);4445SmallBSSSection = getContext().getELFSection(".sbss", ELF::SHT_NOBITS,46ELF::SHF_WRITE | ELF::SHF_ALLOC);47}484950