summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Kanios <keith@kanios.net>2009-07-07 23:09:22 -0500
committerKeith Kanios <keith@kanios.net>2009-07-07 23:09:22 -0500
commit745560e65a2b242b5a5000b69757e215ea4bc880 (patch)
treec28bee9148a243fab673578edd399fe529ccb9ee
parent52a3fbd74dc704bc5f007a28c2c2d05d3404280a (diff)
downloadnasm-745560e65a2b242b5a5000b69757e215ea4bc880.tar.gz
outmacho.c: fix section/relocation alignment issue
-rw-r--r--output/outmacho.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index aeed319b..7e2f0fb3 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -1020,9 +1020,13 @@ static void macho_write_section (void)
of the rest of the address. */
if (!r->ext) {
/* generate final address by section address and offset */
- for (s2 = sects, fi = 1;
- s2 != NULL && fi < r->snum; s2 = s2->next, fi++)
- l += s2->size;
+ for (s2 = sects, fi = 1;
+ s2 != NULL; s2 = s2->next, fi++){
+ if(fi == r->snum){
+ l += s2->addr;
+ break;
+ }
+ }
}
/* write new offset back */