This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix relro when COMMONPAGESIZE < MAXPAGESIZE
- From: Andreas Schwab <schwab at suse dot de>
- To: binutils at sources dot redhat dot com
- Date: Thu, 02 Sep 2004 17:39:34 +0200
- Subject: Fix relro when COMMONPAGESIZE < MAXPAGESIZE
Adjusting the relro end address during DATA_SEGMENT_ALIGN throws aways any
previous data segment alignment, causing the resulting binary to contain a
big hole.
Andreas.
2004-09-02 Andreas Schwab <schwab@suse.de>
* ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: Apply data segment
alignment before adjusting DATA_SEGMENT_RELRO_END.
--- ld/ldexp.c 18 Aug 2004 11:08:48 +0200 1.32
+++ ld/ldexp.c 02 Sep 2004 15:29:34 +0200
@@ -427,6 +427,7 @@ fold_binary (etree_type *tree,
a common page boundary. */
bfd_vma relro;
+ result.value += dot & (maxpage - 1);
relro = exp_data_seg.relro_end - exp_data_seg.base;
result.value += -relro & (other.value - 1);
exp_data_seg.base = result.value;
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."