objcopy prepends directory pathname to symbol name

前端 未结 5 795
刺人心
刺人心 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 11:08

    One simple solution is to transform your text file into what could be used to initialize an array of char. So, you'd get 0x41,0x42,0x43,0x30,0x31,0x32 for "ABC012". You can then #include this sequence of bytes. You can also escape all non-ASCII chars instead of converting everything into bytes so that most of the text is still readable in the generated include file.

提交回复
热议问题