| ... | @@ -419,6 +419,7 @@ pub const Section = struct { | ... | @@ -419,6 +419,7 @@ pub const Section = struct { |
| 419 | } else { | 419 | } else { |
| 420 | const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index]; | 420 | const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index]; |
| 421 | shdr.sh_offset += len; | 421 | shdr.sh_offset += len; |
| | 422 | shdr.sh_size -= len; |
| 422 | atom.value = 0; | 423 | atom.value = 0; |
| 423 | } | 424 | } |
| 424 | atom.size -= len; | 425 | atom.size -= len; |
| ... | @@ -428,7 +429,7 @@ pub const Section = struct { | ... | @@ -428,7 +429,7 @@ pub const Section = struct { |
| 428 | else | 429 | else |
| 429 | &macho_file.sections.items(.header)[sec.index]; | 430 | &macho_file.sections.items(.header)[sec.index]; |
| 430 | header.offset += @intCast(len); | 431 | header.offset += @intCast(len); |
| 431 | header.size = sec.len; | 432 | header.size -= len; |
| 432 | } | 433 | } |
| 433 | } | 434 | } |
| 434 | | 435 | |