1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-14 07:18:42 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-29 17:54:21 +09:00
parent 8e33c93dbb
commit 5f58683412
3 changed files with 17 additions and 3 deletions

View File

@ -487,9 +487,6 @@ int main(int argc, char **argv) {
num_got += got;
num_plt += plt;
});
llvm::outs() << "num_got=" << num_got << "\n"
<< "num_plt=" << num_plt << "\n";
}
// Create linker-synthesized sections.
@ -497,6 +494,7 @@ int main(int argc, char **argv) {
out::phdr = new OutputPhdr;
out::shdr = new OutputShdr;
// out::interp = new InterpSection;
out::got = new GotSection;
out::shstrtab = new ShstrtabSection;
out::symtab = new SymtabSection;
out::strtab = new StrtabSection;

15
mold.h
View File

@ -346,6 +346,20 @@ private:
};
class GotSection : public OutputChunk {
public:
GotSection() {
shdr.sh_flags = llvm::ELF::SHF_ALLOC;
shdr.sh_type = llvm::ELF::SHT_PROGBITS;
}
void copy_to(uint8_t *buf) override {}
u64 get_size() const override { return size; }
u64 size = 0;
std::vector<Symbol *> symbols;
};
class ShstrtabSection : public OutputChunk {
public:
ShstrtabSection() {
@ -410,6 +424,7 @@ extern OutputEhdr *ehdr;
extern OutputShdr *shdr;
extern OutputPhdr *phdr;
extern InterpSection *interp;
extern GotSection *got;
extern ShstrtabSection *shstrtab;
extern SymtabSection *symtab;
extern StrtabSection *strtab;

View File

@ -6,6 +6,7 @@ OutputEhdr *out::ehdr;
OutputShdr *out::shdr;
OutputPhdr *out::phdr;
InterpSection *out::interp;
GotSection *out::got;
ShstrtabSection *out::shstrtab;
SymtabSection *out::symtab;
StrtabSection *out::strtab;