This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix DATA_SEGMENT_ALIGN
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 11 Mar 2002 15:59:40 +0100
- Subject: [PATCH] Fix DATA_SEGMENT_ALIGN
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
If you ever wonder why some sparc64 libraries grew on disk by 1MB recently, this is why:
If common page size (sparc64 8K) is less than maximum page size
(sparc64 has 1M), then for say dot = 0x231c we want:
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x00231c 0x00231c R E 0x100000
LOAD 0x004000 0x0000000000104000 0x0000000000104000 0x002008 0x002008 RWE 0x100000
while binutils without this patch would do:
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x00231c 0x00231c R E 0x100000
LOAD 0x102000 0x0000000000102000 0x0000000000102000 0x002008 0x002008 RWE 0x100000
Ok to commit?
2002-03-11 Jakub Jelinek <jakub@redhat.com>
* ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: If common page size
is smaller than maximum, round dot up to common page boundary.
--- ld/ldexp.c.jj Fri Feb 15 09:42:21 2002
+++ ld/ldexp.c Mon Mar 11 16:01:21 2002
@@ -356,7 +356,8 @@ fold_binary (tree, current_section, allo
}
}
else if (other.value < maxpage)
- result.value += dot & (maxpage - other.value);
+ result.value += (dot + other.value - 1)
+ & (maxpage - other.value);
}
else
result.valid_p = false;
Jakub