public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* gas-940814 ld bugs
       [not found] <9403150407.AA06088@cujo.cygnus.com>
@ 1994-08-14 22:33 ` H.J. Lu
  1994-08-15  8:35   ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 1994-08-14 22:33 UTC (permalink / raw)
  To: Ken Raeburn; +Cc: gas2

gas-940814 configured for i486-linux. If I do

ld -x -Ttext 5ffff000 -Tdata 6008e000 foo.o

the size of the output file is ridiculous. I got

-rwxr-xr-x   1 hjl      isl          8367 Aug 15 01:54 a.out
text    data    bss     dec     hex     filename
4064    4096    0       8160    1fe0    a.out

But I am looking for about 0x8e000 bytes.


H.J.
-------foo.c----
int bar= 100;

void
foo ()
{
  return;
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gas-940814 ld bugs
  1994-08-14 22:33 ` gas-940814 ld bugs H.J. Lu
@ 1994-08-15  8:35   ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1994-08-15  8:35 UTC (permalink / raw)
  To: hjl; +Cc: raeburn, gas2

   From: hjl@nynexst.com (H.J. Lu)
   Date: Mon, 15 Aug 94 1:33:47 EDT

   gas-940814 configured for i486-linux. If I do

   ld -x -Ttext 5ffff000 -Tdata 6008e000 foo.o

   the size of the output file is ridiculous. I got

   -rwxr-xr-x   1 hjl      isl          8367 Aug 15 01:54 a.out
   text    data    bss     dec     hex     filename
   4064    4096    0       8160    1fe0    a.out

   But I am looking for about 0x8e000 bytes.

When you use -Ttext and -Tdata, the linker will link the code as if
the .text and .data sections start at the given address.  It will also
tell BFD to store the given VMA with the section.  It will not insert
extra zero bytes.

The problem, of course, is that a.out has no way to store the starting
VMA of a section.  This is one of several disadvantages of the a.out
format.  The solution is to either use a different object file format,
or to modify the linker script along the lines of
    .text 0x1020 {
	. = 0x5ffff000
	*(.text)
    }

Ian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-08-15  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9403150407.AA06088@cujo.cygnus.com>
1994-08-14 22:33 ` gas-940814 ld bugs H.J. Lu
1994-08-15  8:35   ` Ian Lance Taylor

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