public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: binutils@sources.redhat.com
Subject: [PATCH] Fix DATA_SEGMENT_ALIGN
Date: Mon, 11 Mar 2002 06:59:00 -0000	[thread overview]
Message-ID: <20020311155940.L2204@sunsite.ms.mff.cuni.cz> (raw)

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

             reply	other threads:[~2002-03-11 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11  6:59 Jakub Jelinek [this message]
2002-03-11 13:33 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2002-03-04  7:21 Jakub Jelinek
2002-03-04 15:49 ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020311155940.L2204@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).