aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorjasonliu <jasonliu.development@gmail.com>2020-06-08 18:51:33 +0000
committerjasonliu <jasonliu.development@gmail.com>2020-06-08 19:59:04 +0000
commit775ef44514b333ad042bea37204323bff295643e (patch)
tree999eb8d31e4aa9f17c16f65d8d1fe6e7d2f939af /llvm/lib/Object/XCOFFObjectFile.cpp
parent38674030c026b6ba432dc81440bd3790d94b7c48 (diff)
downloadllvm-775ef44514b333ad042bea37204323bff295643e.zip
llvm-775ef44514b333ad042bea37204323bff295643e.tar.gz
llvm-775ef44514b333ad042bea37204323bff295643e.tar.bz2
[XCOFF][AIX] report_fatal_error when an overflow section is needed
If there are more than 65534 relocation entries in a single section, we should generate an overflow section. Since we don't support overflow section for now, we should generate an error. Differential revision: https://reviews.llvm.org/D81104
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index 55d3323..5333616 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -20,7 +20,6 @@ namespace object {
static const uint8_t FunctionSym = 0x20;
static const uint8_t SymTypeMask = 0x07;
-static const uint16_t RelocOverflow = 65535;
static const uint16_t NoRelMask = 0x0001;
// Checks that [Ptr, Ptr + Size) bytes fall inside the memory buffer
@@ -632,7 +631,7 @@ Expected<uint32_t> XCOFFObjectFile::getLogicalNumberOfRelocationEntries(
uint16_t SectionIndex = &Sec - sectionHeaderTable32() + 1;
- if (Sec.NumberOfRelocations < RelocOverflow)
+ if (Sec.NumberOfRelocations < XCOFF::RelocOverflow)
return Sec.NumberOfRelocations;
for (const auto &Sec : sections32()) {
if (Sec.Flags == XCOFF::STYP_OVRFLO &&