elf: emit .got.plt when emitting .plt

This commit is contained in:
Jakub Konka 2023-10-06 09:54:42 +02:00
parent e53fa93170
commit 2f497f9f05

View File

@ -3962,12 +3962,6 @@ fn initSections(self: *Elf) !void {
.flags = elf.SHF_ALLOC | elf.SHF_WRITE,
.addralign = ptr_size,
});
self.got_plt_section_index = try self.addSection(.{
.name = ".got.plt",
.type = elf.SHT_PROGBITS,
.flags = elf.SHF_ALLOC | elf.SHF_WRITE,
.addralign = @alignOf(u64),
});
}
const needs_rela_dyn = blk: {
@ -3995,6 +3989,12 @@ fn initSections(self: *Elf) !void {
.flags = elf.SHF_ALLOC | elf.SHF_EXECINSTR,
.addralign = 16,
});
self.got_plt_section_index = try self.addSection(.{
.name = ".got.plt",
.type = elf.SHT_PROGBITS,
.flags = elf.SHF_ALLOC | elf.SHF_WRITE,
.addralign = @alignOf(u64),
});
self.rela_plt_section_index = try self.addSection(.{
.name = ".rela.plt",
.type = elf.SHT_RELA,