summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/Platforms/Darwin/ExecutableWriter.cpp6
-rw-r--r--lld/lib/Platforms/Darwin/MachOFormat.hpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/lld/lib/Platforms/Darwin/ExecutableWriter.cpp b/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
index 3ebf3517748..4245e9b0803 100644
--- a/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
+++ b/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
@@ -527,7 +527,8 @@ void SectionChunk::appendAtom(const DefinedAtom *atom) {
if ( align2 > _align2 )
_align2 = align2;
// Assign atom to this section with this offset.
- _atoms.push_back({atom, offset});
+ SectionChunk::AtomInfo ai = {atom, offset};
+ _atoms.push_back(ai);
// Update section size to include this atom.
_size = offset + atom->size();
// Update permissions
@@ -820,7 +821,8 @@ void LoadCommandsChunk::updateLoadCommandContent(const lld::File &file) {
void LoadCommandsChunk::addSection(SectionChunk* chunk) {
- _sectionInfo.push_back({chunk, nullptr, nullptr});
+ LoadCommandsChunk::ChunkSegInfo csi = {chunk, nullptr, nullptr};
+ _sectionInfo.push_back(csi);
}
void LoadCommandsChunk::addLoadCommand(load_command* lc) {
diff --git a/lld/lib/Platforms/Darwin/MachOFormat.hpp b/lld/lib/Platforms/Darwin/MachOFormat.hpp
index 2566f7b0088..55340aa6145 100644
--- a/lld/lib/Platforms/Darwin/MachOFormat.hpp
+++ b/lld/lib/Platforms/Darwin/MachOFormat.hpp
@@ -135,7 +135,7 @@ public:
uint32_t initprot;
uint32_t nsects;
uint32_t flags;
- section_64 sections[];
+ section_64 sections[1];
// The segment_command_64 load commands has a nsect trailing
// section_64 records appended to the end.
@@ -160,7 +160,7 @@ enum {
class dylinker_command : public load_command {
public:
uint32_t name_offset;
- char name[];
+ char name[1];
static dylinker_command* make(const char* path) {
unsigned size = (sizeof(dylinker_command) + strlen(path) + 7) & (-8);
@@ -280,7 +280,7 @@ struct dylib_command : public load_command {
uint32_t timestamp;
uint32_t current_version;
uint32_t compatibility_version;
- char name[];
+ char name[1];
static dylib_command* make(const char* path) {
unsigned size = (sizeof(dylib_command) + strlen(path) + 7) & (-8);
OpenPOWER on IntegriCloud