outmacho: fixed section/relocation alignment issue

This commit is contained in:
Keith Kanios 2009-07-06 21:07:15 -05:00
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 */