bebbo / binutils-gdb

Unofficial mirror of sourceware binutils-gdb repository. Updated daily.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git
GNU General Public License v2.0
3 stars 3 forks source link

"--gc-section" ignores "--undefined" #25

Closed githubaf closed 2 years ago

githubaf commented 2 years ago

"--gc-section" works nicely now and removes all unused stuff.

Sometimes an unused variable should stay in the executable, even if it is not directly used. Examples are the Amiga Version-String $VER or the new $STACK: Token.

There is a linker option to tell the linker, which unused variable or function should be kept. That works in linux gcc but does not work in your Amiga gcc.

Please find an example attached

used_test.zip

bebbo commented 2 years ago

hm, you know that there are preceding underscores on the Amiga?

githubaf commented 2 years ago

You are right! With underscores it works. But I have have to be pointed directly to such obvious solutions ;-)

OK, then it's fine and I have no more complaints here.