3

I want to remove source code file path information from the executable or .o files so that generated core files will not have that information.

I don't want to strip all the debug symbols. In windows there is a flag /FC which can be used to remove file path information. I want to know if similar flag is present for gcc too.

-s i can't use since it will remove all the debugging symbol information.

My gcc version is 4.4.7. centos 6.3 (64 bit)

OR

Is there any way so that i can hide the absolute path information in core file. I am okay with the file names in core file. But i don't want to show absolute path. For me It is showing absolute path only for header files not for .c and .cpp files.

  • Have you tried `-s` ? – quantdev Oct 14 '14 at 11:01
  • It might be specific to your version of `gcc`, or to the target processor and operating system. Please edit your question to tell these. – Basile Starynkevitch Oct 14 '14 at 11:01
  • @BasileStarynkevitch edited the question with the detail –  Oct 14 '14 at 11:12
  • I've not seen anything like that in gcc. Are you sure the /FC flag does that for MSVC, it's documented to expand filenames to full paths in compiler diagnostics(e.g. warnings and errors) and the `__FILE__` macro, and without the /FC flag, the base filename is still included. – nos Oct 14 '14 at 11:17
  • @nos i am not sure. may be you are right. –  Oct 14 '14 at 11:23
  • Take a look at whether http://stackoverflow.com/questions/866721/how-to-generate-gcc-debug-symbol-outside-the-build-target solves your problem. – nos Oct 14 '14 at 11:26
  • @nos thanks for the link. but that too not helping. even I tried -s option of gcc but still the path information is visible in core files :( –  Oct 17 '14 at 09:41

0 Answers0