linux - Does gcc have any options to add version info in ELF binary file? -


i mean whether gcc can insert source code version infor elf binary section or similar. not want change source file, add info gcc option in makefile.

you can emit version info text file, turn text file object file statically link executable.

the first step simple have write code: script or write version info in format plain text file. write makefile rule produce version.o version.txt, using objcopy. you'll have object file 2 useful symbols defined in it: beginning , end of textual version info. add generated object executable, , you'll able access version 2 ways: running strings on binary, or writing code in application print version string (you'll need declare start , end symbols variables in header file).


Comments

Post a Comment

Popular posts from this blog

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -