This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Including files through command line options


Hi Ravi,

Based on a command line option, I want to make GAS include certain
assembly source files (let's assume that I know where the file is for
now).

I've tried setting a flag in md_parse_option, reading that flag in
md_begin and then based on that flag called read_a_source_file on the
file which I wanted to include.

Could anyone advise me if this is the acceptable way of achieving my
objective or if there is a cleaner way of doing this.

It is an acceptable way of achieving your goal. Presumably you are only modifying files specific to the target you are working on, so there is no chance that if there was a bug in your code it would affect other targets.


As for cleaner ways of achieving your objective I would definitely recommend that you consider using the "gcc" program instead. Gcc is quite capable of taking assembler source files which include C preprocessor commands, including the #include directive, processing it and then passing it on to GAS. ie GCC and C preprocessor can already do exactly what you want, so why bother reinventing the wheel ?

Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]