diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-09-27 00:13:56 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-09-28 01:51:38 -0400 |
commit | cee4c731af1e68814548ff00e4e7ecaa8ac07790 (patch) | |
tree | 71a3e95106d618c04ae02810eabf832dc2331e3b /sim | |
parent | 2c02075a8ec5223bc4cbcc9561eb91e28d46a9e5 (diff) | |
download | gdb-cee4c731af1e68814548ff00e4e7ecaa8ac07790.zip gdb-cee4c731af1e68814548ff00e4e7ecaa8ac07790.tar.gz gdb-cee4c731af1e68814548ff00e4e7ecaa8ac07790.tar.bz2 |
sim: drop weak func attrs on module inits
When I first wrote this, I was thinking we'd scan all source files
that existed and generate a complete init list. That means for any
particular build, we'd probably have a few functions that didn't
exist, so weak attributes was necessary. What I ended up scanning
though was only the source files that went into a particular build.
There was another concern too: a source file might be included, but
the build settings would cause all of its contents to be skipped
(via CPP defines). So scanning via naive grep would pick up names
not actually available. A check of the source tree shows that we
never do this, and it's pretty easy to institute a policy that we
don't start (by at the very least including a stub init func).
The use of weak symbols ends up causing a problem in practice: for
a few modules (like profiling), nothing else pulls it in, so the
linker omits it entirely, which leads to the profiling module never
being available. So drop the weak markings since we know all these
funcs will be available.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/common/Make-common.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 8c2cace..c9ea08f 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -443,7 +443,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c) echo '/* It is created automatically by the Makefile. */'; \ echo '#include "libiberty.h"'; \ echo '#include "sim-module.h"'; \ - sed -e 's:\(.*\):extern __attribute__((__weak__)) MODULE_INIT_FN \1;:' $@.l-tmp; \ + sed -e 's:\(.*\):extern MODULE_INIT_FN \1;:' $@.l-tmp; \ echo 'MODULE_INSTALL_FN * const sim_modules_detected[] = {'; \ sed -e 's:\(.*\): \1,:' $@.l-tmp; \ echo '};'; \ |