public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@cygnus.com>
To: tranle@intellicorp.com
Cc: gas2@cygnus.com
Subject: Re: problem with ld (i386-coff) leaving holes in the executable ...
Date: Mon, 08 Aug 1994 07:59:00 -0000	[thread overview]
Message-ID: <199408081459.KAA01744@sanguine.cygnus.com> (raw)
In-Reply-To: <199408071759.KAA13172@cygnus.com>

   Date: Sun, 7 Aug 94 10:57:26 PDT
   From: Minh Tran-Le <TRANLE@intellicorp.com>

   The latest GNU ld does not produce an executable with a consistent
   image header.  If you take each section and add up its scnptr+scnsize
   it does not always match the scnptr of the next section with content.

   And this seems to confuse Emacs unexec which end up dumping the wrong
   content for the .lib section.  

   Does anybody knows why the new ld leave holes in the executable ?

This was done because on a demand paged system, the file position of a
section must match the page position within the executable file,
modulo the page size.  Forcing this alignment permits sections to be
removed from the middle of the file, which is desirable when the
debugging information is stored in a separate COFF section, as it is
for stabs debugging information.

However, this alignment is only required for sections which are
allocated in memory.  Could you please try this patch, and see if it
fixes the problem?

Ian

*** coffcode.h.~15~	Wed Aug  3 10:22:07 1994
--- coffcode.h	Mon Aug  8 10:48:52 1994
*************** coff_compute_section_file_positions (abf
*** 1378,1384 ****
  #ifdef COFF_PAGE_SIZE
        /* In demand paged files the low order bits of the file offset
  	 must match the low order bits of the virtual address.  */
!       if ((abfd->flags & D_PAGED) != 0)
  	sofar += (current->vma - sofar) % COFF_PAGE_SIZE;
  #endif
  
--- 1378,1385 ----
  #ifdef COFF_PAGE_SIZE
        /* In demand paged files the low order bits of the file offset
  	 must match the low order bits of the virtual address.  */
!       if ((abfd->flags & D_PAGED) != 0
! 	  && (current->flags & SEC_ALLOC) != 0)
  	sofar += (current->vma - sofar) % COFF_PAGE_SIZE;
  #endif
  


  reply	other threads:[~1994-08-08  7:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-08-07 10:59 Minh Tran-Le
1994-08-08  7:59 ` Ian Lance Taylor [this message]
1994-08-08 20:11   ` problem with ld (i386-coff) leaving holes in the Minh Tran-Le
1994-08-09  6:58     ` Ian Lance Taylor
1994-08-09 14:11       ` Minh Tran-Le
1994-08-10 10:03         ` Ian Lance Taylor

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=199408081459.KAA01744@sanguine.cygnus.com \
    --to=ian@cygnus.com \
    --cc=gas2@cygnus.com \
    --cc=tranle@intellicorp.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).