This is the mail archive of the binutils@sourceware.org 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: Problem with -mcpu option for GAS on Linux/Alpha


Hi Sergey,


Am I right that ".arch" directive in a .s file has higher priority than "-mcpu" command option.

Yes.


The source file has inline assembler that adds some "ev56" instructions Unfortunatelly, gcc 4.1 (gcc version 4.1.0 20051214 (Red Hat 4.1.0-0.8)) adds ".arch ev5" into output assembler
file and command line option is overwriten by in-file ".arch" directive.
What should be correct behavior?

Add your own ".arch ev6" directive to the inline assembler just before the ev56 instructions are used. (Ideally you would want to save the current architecture, switch to ev6, assemble the required instructions and then switch back. But currently the Alpha port of GAS does not support anything like a .push_arch/.pop_arch pair of pseudos).


Better yet, move the inline assembler out into its own source file and assemble it independently of the rest of the program. That way you should be able to ensure that the correct architecture is set from the command line and that you will not be attempting to assemble gcc generated code with the wrong architecture set.

Cheers
  Nick





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