2

I've read about embedding text files (or any other resource for that matter) into binaries, and I'm doing it like so:

objcopy -I binary -O elf32-littlearm --binary-architecture arm myfile.txt myfile.txt.o

However, unlike in the tutorial, I get the following response:

ld: unknown architecture of input file `myfile.txt' is incompatible with arm output

The example uses i386 but this doesn't seem to be the issue either as I can't do it that way either.

Is there a way I can force objcopy to ignore the fact it's a text file and not a valid compatible binary so it just copies it byte-for-byte into my program?

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Chris Watts
  • 6,197
  • 7
  • 49
  • 98

1 Answers1

0

For data only object file (no code), you can skip binary-architecture option.

So the following should work

objcopy -I binary -O elf32-littlearm myfile.txt myfile.txt.o to generate object file.

onemouth
  • 2,252
  • 16
  • 31