| ... | @@ -1,6 +1,5 @@ | ... | @@ -1,6 +1,5 @@ |
| 1 | base: link.File, | 1 | base: link.File, |
| 2 | image_base: u64, | 2 | image_base: u64, |
| 3 | eh_frame_hdr: bool, | | |
| 4 | emit_relocs: bool, | 3 | emit_relocs: bool, |
| 5 | z_nodelete: bool, | 4 | z_nodelete: bool, |
| 6 | z_notext: bool, | 5 | z_notext: bool, |
| ... | @@ -306,7 +305,6 @@ pub fn createEmpty( | ... | @@ -306,7 +305,6 @@ pub fn createEmpty( |
| 306 | }; | 305 | }; |
| 307 | }, | 306 | }, |
| 308 | | 307 | |
| 309 | .eh_frame_hdr = options.eh_frame_hdr, | | |
| 310 | .emit_relocs = options.emit_relocs, | 308 | .emit_relocs = options.emit_relocs, |
| 311 | .z_nodelete = options.z_nodelete, | 309 | .z_nodelete = options.z_nodelete, |
| 312 | .z_notext = options.z_notext, | 310 | .z_notext = options.z_notext, |
| ... | @@ -1726,7 +1724,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { | ... | @@ -1726,7 +1724,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { |
| 1726 | try argv.append("--print-gc-sections"); | 1724 | try argv.append("--print-gc-sections"); |
| 1727 | } | 1725 | } |
| 1728 | | 1726 | |
| 1729 | if (self.eh_frame_hdr) { | 1727 | if (comp.link_eh_frame_hdr) { |
| 1730 | try argv.append("--eh-frame-hdr"); | 1728 | try argv.append("--eh-frame-hdr"); |
| 1731 | } | 1729 | } |
| 1732 | | 1730 | |
| ... | @@ -2437,7 +2435,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v | ... | @@ -2437,7 +2435,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v |
| 2437 | man.hash.add(self.image_base); | 2435 | man.hash.add(self.image_base); |
| 2438 | man.hash.add(self.base.gc_sections); | 2436 | man.hash.add(self.base.gc_sections); |
| 2439 | man.hash.addOptional(self.sort_section); | 2437 | man.hash.addOptional(self.sort_section); |
| 2440 | man.hash.add(self.eh_frame_hdr); | 2438 | man.hash.add(comp.link_eh_frame_hdr); |
| 2441 | man.hash.add(self.emit_relocs); | 2439 | man.hash.add(self.emit_relocs); |
| 2442 | man.hash.add(comp.config.rdynamic); | 2440 | man.hash.add(comp.config.rdynamic); |
| 2443 | man.hash.addListOfBytes(self.lib_dirs); | 2441 | man.hash.addListOfBytes(self.lib_dirs); |
| ... | @@ -2633,7 +2631,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v | ... | @@ -2633,7 +2631,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v |
| 2633 | try argv.append("--print-map"); | 2631 | try argv.append("--print-map"); |
| 2634 | } | 2632 | } |
| 2635 | | 2633 | |
| 2636 | if (self.eh_frame_hdr) { | 2634 | if (comp.link_eh_frame_hdr) { |
| 2637 | try argv.append("--eh-frame-hdr"); | 2635 | try argv.append("--eh-frame-hdr"); |
| 2638 | } | 2636 | } |
| 2639 | | 2637 | |
| ... | @@ -3317,6 +3315,9 @@ pub fn deleteDeclExport( | ... | @@ -3317,6 +3315,9 @@ pub fn deleteDeclExport( |
| 3317 | } | 3315 | } |
| 3318 | | 3316 | |
| 3319 | fn addLinkerDefinedSymbols(self: *Elf) !void { | 3317 | fn addLinkerDefinedSymbols(self: *Elf) !void { |
| | 3318 | const comp = self.base.comp; |
| | 3319 | const gpa = comp.gpa; |
| | 3320 | |
| 3320 | const linker_defined_index = self.linker_defined_index orelse return; | 3321 | const linker_defined_index = self.linker_defined_index orelse return; |
| 3321 | const linker_defined = self.file(linker_defined_index).?.linker_defined; | 3322 | const linker_defined = self.file(linker_defined_index).?.linker_defined; |
| 3322 | self.dynamic_index = try linker_defined.addGlobal("_DYNAMIC", self); | 3323 | self.dynamic_index = try linker_defined.addGlobal("_DYNAMIC", self); |
| ... | @@ -3331,7 +3332,7 @@ fn addLinkerDefinedSymbols(self: *Elf) !void { | ... | @@ -3331,7 +3332,7 @@ fn addLinkerDefinedSymbols(self: *Elf) !void { |
| 3331 | self.plt_index = try linker_defined.addGlobal("_PROCEDURE_LINKAGE_TABLE_", self); | 3332 | self.plt_index = try linker_defined.addGlobal("_PROCEDURE_LINKAGE_TABLE_", self); |
| 3332 | self.end_index = try linker_defined.addGlobal("_end", self); | 3333 | self.end_index = try linker_defined.addGlobal("_end", self); |
| 3333 | | 3334 | |
| 3334 | if (self.eh_frame_hdr) { | 3335 | if (comp.link_eh_frame_hdr) { |
| 3335 | self.gnu_eh_frame_hdr_index = try linker_defined.addGlobal("__GNU_EH_FRAME_HDR", self); | 3336 | self.gnu_eh_frame_hdr_index = try linker_defined.addGlobal("__GNU_EH_FRAME_HDR", self); |
| 3336 | } | 3337 | } |
| 3337 | | 3338 | |
| ... | @@ -3345,7 +3346,6 @@ fn addLinkerDefinedSymbols(self: *Elf) !void { | ... | @@ -3345,7 +3346,6 @@ fn addLinkerDefinedSymbols(self: *Elf) !void { |
| 3345 | | 3346 | |
| 3346 | for (self.shdrs.items) |shdr| { | 3347 | for (self.shdrs.items) |shdr| { |
| 3347 | if (self.getStartStopBasename(shdr)) |name| { | 3348 | if (self.getStartStopBasename(shdr)) |name| { |
| 3348 | const gpa = self.base.comp.gpa; | | |
| 3349 | try self.start_stop_indexes.ensureUnusedCapacity(gpa, 2); | 3349 | try self.start_stop_indexes.ensureUnusedCapacity(gpa, 2); |
| 3350 | | 3350 | |
| 3351 | const start = try std.fmt.allocPrintZ(gpa, "__start_{s}", .{name}); | 3351 | const start = try std.fmt.allocPrintZ(gpa, "__start_{s}", .{name}); |
| ... | @@ -3510,7 +3510,7 @@ fn initSyntheticSections(self: *Elf) !void { | ... | @@ -3510,7 +3510,7 @@ fn initSyntheticSections(self: *Elf) !void { |
| 3510 | .offset = std.math.maxInt(u64), | 3510 | .offset = std.math.maxInt(u64), |
| 3511 | }); | 3511 | }); |
| 3512 | | 3512 | |
| 3513 | if (self.eh_frame_hdr) { | 3513 | if (comp.link_eh_frame_hdr) { |
| 3514 | self.eh_frame_hdr_section_index = try self.addSection(.{ | 3514 | self.eh_frame_hdr_section_index = try self.addSection(.{ |
| 3515 | .name = ".eh_frame_hdr", | 3515 | .name = ".eh_frame_hdr", |
| 3516 | .type = elf.SHT_PROGBITS, | 3516 | .type = elf.SHT_PROGBITS, |