mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 18:40:59 +03:00
temporary
This commit is contained in:
parent
fc7d792853
commit
da438af6ef
4
main.cc
4
main.cc
@ -320,7 +320,7 @@ int main(int argc, char **argv) {
|
||||
int i = 0;
|
||||
while (i < output_chunks.size() && !output_chunks[i]->is_bss()) {
|
||||
int j = i + 1;
|
||||
while (j < output_chunks.size() && !output_chunks[j]->starts_segment &&
|
||||
while (j < output_chunks.size() && !output_chunks[j]->starts_new_ptload &&
|
||||
!output_chunks[j]->is_bss())
|
||||
j++;
|
||||
|
||||
@ -366,7 +366,7 @@ int main(int argc, char **argv) {
|
||||
if (last->is_bss())
|
||||
fileoff = last->shdr.sh_offset;
|
||||
else
|
||||
fileoff = last->shdr.sh_offset + last->shdr.sh_size;
|
||||
fileoff = last->shdr.sh_offset + last->get_filesz();
|
||||
}
|
||||
|
||||
for (OutputChunk *chunk : output_chunks) {
|
||||
|
2
mold.h
2
mold.h
@ -234,7 +234,7 @@ public:
|
||||
virtual uint64_t get_filesz() const = 0;
|
||||
|
||||
StringRef name;
|
||||
bool starts_segment = false;
|
||||
bool starts_new_ptload = false;
|
||||
ELF64LE::Shdr shdr = {};
|
||||
};
|
||||
|
||||
|
@ -100,7 +100,8 @@ void OutputPhdr::construct(std::vector<OutputChunk *> &chunks) {
|
||||
ent.phdr.p_align = std::max(ent.phdr.p_align, chunk->shdr.sh_addralign);
|
||||
|
||||
for (Phdr &ent : entries)
|
||||
ent.members.front()->starts_segment = true;
|
||||
if (ent.phdr.p_type == PT_LOAD)
|
||||
ent.members.front()->starts_new_ptload = true;
|
||||
}
|
||||
|
||||
void OutputPhdr::copy_to(uint8_t *buf) {
|
||||
|
Loading…
Reference in New Issue
Block a user