Fix relro when COMMONPAGESIZE < MAXPAGESIZE

Andreas Schwab schwab@suse.de
Tue Sep 7 22:36:00 GMT 2004


Jakub Jelinek <jakub@redhat.com> writes:

> On Thu, Sep 02, 2004 at 05:39:34PM +0200, Andreas Schwab wrote:
>> 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.
>
> Can you post readelf -WS output before and after the patch?
> The big hole was certainly intended there, so that MAXPAGESIZE is properly
> honored.

The big hole had nearly MAXPAGESIZE bytes, which is surely not intented
(especially when text size is much smaller than that).

Here's the text/data boundary:

  [18] .eh_frame         PROGBITS        00000000000088e8 0088e8 000cac 00   A  0   0  8
  [19] .ctors            PROGBITS        000000000010a370 00a370 000010 00  WA  0   0  8

Without the patch section .ctors is placed at 0x100ddc, giving a wastage
of 1010284 bytes in the file, which is more than 26 times the text segment
size.

Andreas.

-- 
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."



More information about the Binutils mailing list