1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 10:54:56 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-22 19:41:27 +09:00
parent 2c654752a5
commit 88bdcbf009
2 changed files with 12 additions and 4 deletions

14
main.cc
View File

@ -223,20 +223,26 @@ int main(int argc, char **argv) {
isec->output_section->chunks.push_back(isec);
bin_sections_timer.stopTimer();
// Create an ELF header, a section header and a program header.
std::vector<OutputChunk *> output_chunks;
// Create linker-synthesized sections.
out::ehdr = new OutputEhdr;
out::phdr = new OutputPhdr;
out::shstrtab = new StringTableSection(".shstrtab");
// Add ELF and program header to the output.
std::vector<OutputChunk *> output_chunks;
output_chunks.push_back(out::ehdr);
output_chunks.push_back(out::phdr);
// Add .interp section
// Add .interp section.
output_chunks.push_back(new InterpSection);
// Add other output sections
// Add other output sections.
for (OutputSection *osec : get_output_sections())
output_chunks.push_back(osec);
// Add a string table for section names.
output_chunks.push_back(out::shstrtab);
// Create program header contents.
out::phdr->hdr = create_phdrs();

View File

@ -5,6 +5,8 @@ using namespace llvm::ELF;
OutputEhdr *out::ehdr;
OutputShdr *out::shdr;
OutputPhdr *out::phdr;
StringTableSection *out::shstrtab;
std::vector<OutputSection *> OutputSection::all_instances;
void OutputEhdr::relocate(uint8_t *buf) {