| ... | @@ -1124,6 +1124,19 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node | ... | @@ -1124,6 +1124,19 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1124 | } | 1124 | } |
| 1125 | try self.writeObjects(); | 1125 | try self.writeObjects(); |
| 1126 | | 1126 | |
| | 1127 | // Look for entry address in objects if not set by the incremental compiler. |
| | 1128 | if (self.entry_addr == null) { |
| | 1129 | const entry: ?[]const u8 = entry: { |
| | 1130 | if (self.base.options.entry) |entry| break :entry entry; |
| | 1131 | if (!self.isDynLib()) break :entry "_start"; |
| | 1132 | break :entry null; |
| | 1133 | }; |
| | 1134 | self.entry_addr = if (entry) |name| entry_addr: { |
| | 1135 | const global_index = self.globalByName(name) orelse break :entry_addr null; |
| | 1136 | break :entry_addr self.symbol(global_index).value; |
| | 1137 | } else null; |
| | 1138 | } |
| | 1139 | |
| 1127 | // Generate and emit the symbol table. | 1140 | // Generate and emit the symbol table. |
| 1128 | try self.updateSymtabSize(); | 1141 | try self.updateSymtabSize(); |
| 1129 | try self.writeSymtab(); | 1142 | try self.writeSymtab(); |