objcopy prepends directory pathname to symbol name

前端 未结 5 796
刺人心
刺人心 2020-12-31 10:30

I am tying to use objcopy to include a binary form of a text file into an executable. (At runtime I need the file as a string). This works fine until the linker

5条回答
  •  一整个雨季
    2020-12-31 10:52

    Another alternative which I have used is to cd to the source directory and then give objcopy the basename of the source. In bash, this would be:

    cd $(dirname $SOURCE)
    objcopy ... $(basename $SOURCE) $TARGET
    

    This way the symbols generated are always _binary_file_name_xxx without the path.

提交回复
热议问题