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?
How can I get gcc to add a prefix to all symbol names
10.5k Views Asked by danielhauagge At
2
There are 2 best solutions below
2
hide0
On
*EDIT: George Skoptsov's solution's better than mine :) The nm trick might come in handy though.
This is not exactly what you are looking for, but I have had to do something similar in the past (renaming the symbols exported by a library)
If you know the names of the symbols you want to redefine you can try using objcopy --redefine-syms old=new . See the man pages of objcopy for more details on the input (objcopy might overwrite your file so be careful with that)
If you do not know the names of the symbols you can trying using nm to get a list of symbols. Again, since I am not sure what kind of symbols you are looking for, the man pages will probably be your best bet.
Related Questions in C++
- C++ using std::vector across boundaries
- Linked list without struct
- Connecting Signal QML to C++ (Qt5)
- how to get the reference of struct soap inherited in C++ Proxy/Service class
- Why we can't assign value to pointer
- Conversion of objects in c++
- shared_ptr: "is not a type" error
- C++ template using pointer and non pointer arguments in a QVector
- C++ SFML 2.2 vectors
- Lifetime of temporary objects
- I want to be able to use 4 different variables in a select statement in c ++
- segmentation fault: 11, extracting data in vector
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- How can I print all the values in this linked list inside a hash table?
- Configured TTL for A record(s) backing CNAME records
Related Questions in C
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in GCC
- gcc static library compilation
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
- How to add directories to Cygwin gcc default search path
- Usage of #ifndef directive
- Failure to link a program with gcc -static
- Text as parameter in inline assembly (ARM)?
- Alternatives for strrspn and strfind functions(libgen functions in Solaris) in AIX?
- Incorrect format specifier with gcc compiler
- Why should I use a closing bracket in this?
- How can I compile *without* various instruction sets enabled?
- Automatically wrap C/C++ function at compile-time with annotation
- gcc compiled library: can successfully link with, how come it's "undefined symbol" when run the program?
- compiling caffe on Yosemite
- error - /usr/bin/ld: cannot find -lavutil in ubuntu 15.04
- Compatibility of libstdc++.so libgcc_s.so when upgrading GCC 4.1 to GCC 4.8.2
Related Questions in G++
- Using std::vector<> and std::shared_ptr<> should cause error
- C++ string and char* manipulation acting weird
- Seg fault when trying to compile PhantomJS from source on CentOS 7
- There is a way in gcc to get a warning when a constexpr can't be evaluated at compile time?
- GCC expected template-name before ‘<’ token error
- C++ What determines which version of C++ can run on a specific architecture (like Arduino)
- C++ unsigned long doesn't wrap around after 4294967295
- Exception not caught on -O2
- Relationship between gcc, g++, cygwin, and wingw?
- Getting unexpected "undefined reference to" errors when compiling with a static library
- SIGSEGV with std::map of pointers to template objects
- OpenGl XUbuntu 14.04 glShaderSource, glCompileShader, glCreateProgram functions not declared
- g++: error: unrecognized command line option ‘-stdlib=libstdc++’
- OpenMP support on OpenBSD
- Is it possible to merge coverage data from two executables with gcov/gcovr?
Related Questions in PRE-COMPILATION
- Maximum value for IIS .NET Compilation Batch Time-out
- sprockets - precompiling a standalone asset
- How do I get a TFS build to precompile a web application using a saved publish profile?
- How to set ISPP defines based on default Inno Setup variables?
- Are include guards considered defined after the #define directive or after the #endif directive
- Complexity of IDE error detection and auto-completion dependent upon language syntax?
- What do I specify as the "target folder" parameter to ClientBuildManager constructor?
- How to properly hardcode compiler's define flag (-D) with #define in c (arduino)
- Static files are served up in development but not in production
- Precompiling Handlebars.js templates in Windows
- calling precompiled module from another file
- Could not load type 'ASP.xxx' when referencing a precompiled master page
- HP Fortify scans get ASP Pre-Compilation error
- Rails only precompiles *some* files on production
- Rails assets precompilation removes functions from global scope (TypeError: object is not a function). How to get them back?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I believe this answer will give you the solution.
In short, you can 'prefix' symbols in an existing library using
objcopylike this: