I would appreciate it if people with experience with the following
config
files could make sure I didn't do the wrong thing in there by
accident:
gcc/config/arm/pe.h
gcc/config/i386/cygming.h
gcc/config/mcore/mcore.h
gcc/config/pa/som.h
The som.h change is not correct. The macro ASM_OUTPUT_FUNCTION_PREFIX
is partially a reminant from named sections which were deleted a couple
of years due to problems with nm and collect2. This macro essentially
emits the equivalent of a .section directive before starting to output
a function. If you look at varasm.c, you will see it is not suitable
for switching sections.
The .nsubspa directive creates a new subspace with the name $CODE$.
The subtle aspect to .nsubspa is that there can be multiple subspaces
all with the name $CODE$ and they are all unique. How the linker
sorts these subspaces is more or less up to it. The .subspa
direction can be used to switch to an existing subspace with a given
name. However, when you have multiple subspaces with the same name,
I believe .subspa will put you in the first (default) subspace with
the specified name. This is not what's needed for switching back and
forth between sections.
Currently, we never switch subspaces while emitting the body of a
function. We are very dependent on knowning the distance between
insns for the emissions of branches and the distance to the beginning
of the function for calls. Assuming we start outputing text and
then switch to emitting unlikely text in a new subspace, this is
going to have lots of implications for branches between the two
subspaces. Effectively, these become calls. GAS currently doesn't
support calls to alternate entry points. So, I don't think this
is going to work with SOM without a lot of careful thought. It's
also going to interact with a patch I'm about to submit regarding
COMDAT support.
Dave
--
J. David Anglin
dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX:
952-6602)