1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 10:27:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-17 13:34:02 +09:00
parent e6f4a3e875
commit 18dee311b0
3 changed files with 8 additions and 5 deletions

View File

@ -811,8 +811,7 @@ int main(int argc, char **argv) {
out::phdr = new OutputPhdr;
out::got = new SpecialSection(".got", SHT_PROGBITS, SHF_ALLOC | SHF_WRITE, 8);
out::gotplt = new GotPltSection;
out::relplt = new SpecialSection(".rela.plt", SHT_RELA, SHF_ALLOC,
8, sizeof(ELF64LE::Rela));
out::relplt = new RelPltSection;
out::strtab = new StrtabSection(".strtab", 0);
out::shstrtab = new ShstrtabSection;
out::plt = new PltSection;
@ -955,8 +954,6 @@ int main(int argc, char **argv) {
out::files = files;
out::chunks = chunks;
out::relplt->shdr.sh_link = out::dynsym->shndx;
for (OutputChunk *chunk : chunks)
chunk->update_shdr();

4
mold.h
View File

@ -437,6 +437,8 @@ public:
shdr.sh_entsize = sizeof(ELF64LE::Rela);
shdr.sh_addralign = 8;
}
void update_shdr() override;
};
class RelDynSection : public OutputChunk {
@ -600,7 +602,7 @@ inline OutputPhdr *phdr;
inline InterpSection *interp;
inline SpecialSection *got;
inline GotPltSection *gotplt;
inline SpecialSection *relplt;
inline RelPltSection *relplt;
inline RelDynSection *reldyn;
inline DynamicSection *dynamic;
inline StrtabSection *strtab;

View File

@ -179,6 +179,10 @@ static std::vector<u64> create_dynamic_section() {
return vec;
}
void RelPltSection::update_shdr() {
shdr.sh_link = out::dynsym->shndx;
}
void RelDynSection::update_shdr() {
shdr.sh_link = out::dynsym->shndx;
}