Insert comments into AVR-OBJCOPY options file

Hi all,

When compiling code for the AVR (or anything else under GCC), the program used to convert an object file into an Intel HEX format file is AVR-OBJCOPY.

A typical AVR-OBJCOPY line (as output from the IDE, or as used in a Makefile) looks something like this:

[b]avr-objcopy -O ihex -R .eeprom --preserve-dates [infile.elf] [outfile.hex][/b]

This line means "copy the ELF file to a HEX file in IHEX output format and leave out the EEPROM section and preserve file datestamps".

Now, AVR-OBJCOPY can also place all command line options into a file and read that file instead of having the options "canned" in the command line by using the "@" option, for example:

Contents of "hexfile.opts"

[b]-O ihex
-R .eeprom
--preserve-dates[/b]

...and the new command line:

[b]avr-objcopy @hexfile.opts [infile.elf] [outfile.hex][/b]

My question is... can COMMENTS be placed in the "options" file? For example, in "hexfile.opts":

[b]# this is a comment in the options file used by avr-objcopy
# and this is another comment
[tt]-O ihex
-R .eeprom
--preserve-dates

[/b][/tt]Ive checked online and I've tried the obvious such as "#comment, /* comment */, ' comment, .comment, ; comment, and // comment" but none work (that is, they trigger an error that results in AVR-OBJCOPY printing the help screen).

Any help will be appreciated. Thanks!

The other options of objcopy taking a file as parameter allow indeed to introduce Line comments by the hash character. Seems they did not care to take the same convention (I think it's a pure replacement of the @file in the command line with what is (recursively) in the file