mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
outmacho: fixed section/relocation alignment issue
This commit is contained in:
parent
740df43005
commit
5051c63d7e
@ -985,7 +985,7 @@ static void macho_write_section (void)
|
||||
{
|
||||
struct section *s, *s2;
|
||||
struct reloc *r;
|
||||
uint8_t *p, *q, blk[4];
|
||||
uint8_t fi, *p, *q, blk[4];
|
||||
int32_t l;
|
||||
|
||||
for (s = sects; s != NULL; s = s->next) {
|
||||
@ -1020,9 +1020,9 @@ static void macho_write_section (void)
|
||||
of the rest of the address. */
|
||||
if (!r->ext) {
|
||||
/* generate final address by section address and offset */
|
||||
s2 = get_section_by_index(r->snum);
|
||||
if(s2)
|
||||
l += s2->addr; // else what?!?
|
||||
for (s2 = sects, fi = 1;
|
||||
s2 != NULL && fi < r->snum; s2 = s2->next, fi++)
|
||||
l += s2->size;
|
||||
}
|
||||
|
||||
/* write new offset back */
|
||||
|
Loading…
x
Reference in New Issue
Block a user