aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorHenry Jiang <h243jian@uwaterloo.ca>2025-04-03 17:01:18 -0400
committerGitHub <noreply@github.com>2025-04-03 17:01:18 -0400
commit7d3dfc862d283319d01997c0672c50b4a082aa4e (patch)
tree0bb1f77204d1c15506aa12894959212de3db9b4f /llvm/lib/Object/XCOFFObjectFile.cpp
parent5f99e0d4b9ea071e29a9cba75619d26811ff76c2 (diff)
downloadllvm-7d3dfc862d283319d01997c0672c50b4a082aa4e.zip
llvm-7d3dfc862d283319d01997c0672c50b4a082aa4e.tar.gz
llvm-7d3dfc862d283319d01997c0672c50b4a082aa4e.tar.bz2
[JITLink][XCOFF] Setup initial build support for XCOFF (#127266)
This patch starts the initial implementation of JITLink for XCOFF (Object format for AIX).
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index df3b2a0..5a24643 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -429,9 +429,13 @@ XCOFFObjectFile::getSectionContents(DataRefImpl Sec) const {
}
uint64_t XCOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const {
- uint64_t Result = 0;
- llvm_unreachable("Not yet implemented!");
- return Result;
+ // TODO: Copied from MC/XCOFFObjectWriter.cpp
+ // Sections other than DWARF section use DefaultSectionAlign as the default
+ // alignment, while DWARF sections have their own alignments. DWARF section
+ // alignment is bigger than DefaultSectionAlign.
+ if (isDebugSection(Sec))
+ return 8;
+ return 4;
}
uint64_t XCOFFObjectFile::getSectionFileOffsetToRawData(DataRefImpl Sec) const {