This is the mail archive of the
mailing list for the binutils project.
Re: reordering procedures
- To: lefurgy at eecs dot umich dot edu
- Subject: Re: reordering procedures
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 18 Oct 1999 15:48:24 -0400
- CC: binutils at sourceware dot cygnus dot com
- References: <199910162308.TAA08906@noey.eecs.umich.edu>
Date: Sat, 16 Oct 1999 19:08:10 -0400
From: Charles Lefurgy <email@example.com>
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.