public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: Minh Tran-Le <TRANLE@intellicorp.com>
To: ian@cygnus.com
Cc: gas2@cygnus.com
Subject: Re: problem with ld (i386-coff) leaving holes in the
Date: Mon, 08 Aug 1994 20:11:00 -0000	[thread overview]
Message-ID: <199408090249.AA13574@bridge2.NSD.3Com.COM> (raw)
In-Reply-To: <199408081459.KAA01744@sanguine.cygnus.com>

Ian Lance Taylor <ian@cygnus.com> wrote:
|
|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
|


This patch seems to work fine for me on small executable but on emacs
it still fail and still try to page align the `.comment' section.

I made ld printout the section name and flags in the case it wants to
page align it.

section .text: flags 0x237
section .data: flags 0x247
section .comment: flags 0x10203
section .lib: flags 0x203


== output of: dump -h temacs ==

			***SECTION HEADER***
	Name        Paddr       Vaddr       Scnptr      Relptr     Lnnoptr
	            Flags                    Size       Nreloc      Nlnno

temacs:
	.text     0x00000148  0x00000148  0x00000148  0x00000000  0x0014e2a8
	          0x00000020              0x000e731c        0           2

	.data     0x00400464  0x00400464  0x000e7464  0x00000000  0x00000000
	          0x00000040              0x00047bc4        0           0

	.bss      0x00448028  0x00448028  0x00000000  0x00000000  0x00000000
	          0x00000080              0x00025ff8        0           0

                                        /* page aligned here */

	.comment  0x0046e020  0x0046e020  0x00130020  0x00000000  0x00000000
	          0x00000200              0x0001e270        0           0

	.fkd800   0xd8000000  0xd8000000  0x00000000  0x00000000  0x00000000
	          0x00000022              0x0003a858        0           0

	.lib      0x00000001  0x00000000  0x0014e290  0x00000000  0x00000000
	          0x00000800              0x00000018        0           0

	.fkdc00   0xdc000000  0xdc000000  0x00000000  0x00000000  0x00000000
	          0x00000042              0x0000f28c        0           0


I have tried to comment out the code that was doing the page align
and it cure the problem with emacs unexec without any adverse effect.

Does all standard COFF linker do this page align thing ? Does emacs unexec
work fine with them ?

Thanks,
Minh Tran-Le.
-------


  reply	other threads:[~1994-08-08 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-08-07 10:59 problem with ld (i386-coff) leaving holes in the executable Minh Tran-Le
1994-08-08  7:59 ` Ian Lance Taylor
1994-08-08 20:11   ` Minh Tran-Le [this message]
1994-08-09  6:58     ` problem with ld (i386-coff) leaving holes in the 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=199408090249.AA13574@bridge2.NSD.3Com.COM \
    --to=tranle@intellicorp.com \
    --cc=gas2@cygnus.com \
    --cc=ian@cygnus.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).