How can I get gcc to add a prefix to all symbol names
问题 I know that in the past there was an option -fprefix-function-name that would add a prefix to all generated symbols, it doesn't seem to be part of gcc anymore. Is there any other way to do this? 回答1: I believe this answer will give you the solution. In short, you can 'prefix' symbols in an existing library using objcopy like this: objcopy --prefix-symbols=foo_ foo.o 回答2: *EDIT: George Skoptsov's solution's better than mine :) The nm trick might come in handy though. This is not exactly what