mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 01:15:14 +00:00
elf+aarch64: set _GLOBAL_OFFSET_TABLE_ to .got section
This commit is contained in:
parent
d9069cbe2c
commit
b5642b4f85
@ -3170,11 +3170,20 @@ fn allocateLinkerDefinedSymbols(self: *Elf) void {
|
||||
}
|
||||
|
||||
// _GLOBAL_OFFSET_TABLE_
|
||||
if (self.got_plt_section_index) |shndx| {
|
||||
const shdr = &self.shdrs.items[shndx];
|
||||
const symbol_ptr = self.symbol(self.got_index.?);
|
||||
symbol_ptr.value = shdr.sh_addr;
|
||||
symbol_ptr.output_section_index = shndx;
|
||||
if (self.getTarget().cpu.arch == .x86_64) {
|
||||
if (self.got_plt_section_index) |shndx| {
|
||||
const shdr = self.shdrs.items[shndx];
|
||||
const sym = self.symbol(self.got_index.?);
|
||||
sym.value = shdr.sh_addr;
|
||||
sym.output_section_index = shndx;
|
||||
}
|
||||
} else {
|
||||
if (self.got_section_index) |shndx| {
|
||||
const shdr = self.shdrs.items[shndx];
|
||||
const sym = self.symbol(self.got_index.?);
|
||||
sym.value = shdr.sh_addr;
|
||||
sym.output_section_index = shndx;
|
||||
}
|
||||
}
|
||||
|
||||
// _PROCEDURE_LINKAGE_TABLE_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user