]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
sim: drop weak func attrs on module inits
authorMike Frysinger <vapier@gentoo.org>
Mon, 27 Sep 2021 04:13:56 +0000 (00:13 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 28 Sep 2021 05:51:38 +0000 (01:51 -0400)
commitcee4c731af1e68814548ff00e4e7ecaa8ac07790
tree71a3e95106d618c04ae02810eabf832dc2331e3b
parent2c02075a8ec5223bc4cbcc9561eb91e28d46a9e5
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.
sim/common/Make-common.in