mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
MC: adjust text section flags for WoA
Correct the section flags for code built for Windows on ARM with `-ffunction-sections`. Windows on ARM uses solely Thumb-2 instructions, and indicates that the function is thumb by placing it in a text section that has IMAGE_SCN_MEM_16BIT flag set. When we encounter a .section directive, a new section is constructed. This may be a text segment. In order to identify that we need the additional flag, expose the target triple through the ObjectFileInfo as this information is lost otherwise. Since any modern ARM targeting environment on Windows would be Thumb-2 (Windows ARM NT or Windows Embedded Compact), introducing a new flag to indicate the section attribute seems to be a bit overkill. Simply depend on the target triple. Since there is one location that this information is currently needed, creating a target specific assembly parser and delegating the parsing of section switches also feels a bit heavy handed. If it turns out that this information ends up changing additional behaviour, then it may be worth considering that alternative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211481 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
#ifndef LLVM_MC_MCBJECTFILEINFO_H
|
||||
#define LLVM_MC_MCBJECTFILEINFO_H
|
||||
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Support/CodeGen.h"
|
||||
|
||||
namespace llvm {
|
||||
class MCContext;
|
||||
class MCSection;
|
||||
class StringRef;
|
||||
class Triple;
|
||||
|
||||
class MCObjectFileInfo {
|
||||
protected:
|
||||
@@ -380,6 +380,7 @@ private:
|
||||
Reloc::Model RelocM;
|
||||
CodeModel::Model CMModel;
|
||||
MCContext *Ctx;
|
||||
Triple TT;
|
||||
|
||||
void InitMachOMCObjectFileInfo(Triple T);
|
||||
void InitELFMCObjectFileInfo(Triple T);
|
||||
@@ -388,6 +389,9 @@ private:
|
||||
/// InitEHFrameSection - Initialize EHFrameSection on demand.
|
||||
///
|
||||
void InitEHFrameSection();
|
||||
|
||||
public:
|
||||
const Triple &getTargetTriple() const { return TT; }
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
Reference in New Issue
Block a user