public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* reordering procedures
@ 1999-10-16 16:08 Charles Lefurgy
  1999-10-18 12:49 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Lefurgy @ 1999-10-16 16:08 UTC (permalink / raw)
  To: binutils

I'm doing some code layout experiments.  I would like to use binutils
(BFD) to re-order procedures in a binary executable (mips-coff).

Is it even possible?  If so, is there an easy way to do this?  What
are the steps involved?  What about relocations?

Thanks,

--Charles Lefurgy

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

* Re: reordering procedures
  1999-10-16 16:08 reordering procedures Charles Lefurgy
@ 1999-10-18 12:49 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1999-10-18 12:49 UTC (permalink / raw)
  To: lefurgy; +Cc: binutils

   Date: Sat, 16 Oct 1999 19:08:10 -0400
   From: Charles Lefurgy <lefurgy@eecs.umich.edu>

   I'm doing some code layout experiments.  I would like to use binutils
   (BFD) to re-order procedures in a binary executable (mips-coff).

   Is it even possible?  If so, is there an easy way to do this?  What
   are the steps involved?  What about relocations?

You can reorder sections easily enough--the linker script language
permits you to do that in various ways--but you can not in general
reorder procedures within a single section.  In certain specific cases
it may be possible.  However, BFD will not help you very much.

I assume that by mips-coff you mean ECOFF.  ECOFF is a poor choice for
this sort of work because it does not permit arbitrary sections.  I
recommend using ELF, and the gcc -ffunction-sections option to put
each function in a different section.  It will then be more or less
straightforward to generate a linker script which puts the sections in
whatever order you like.

Ian

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

end of thread, other threads:[~1999-10-18 12:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-16 16:08 reordering procedures Charles Lefurgy
1999-10-18 12:49 ` 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).