This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Problem with -mcpu option for GAS on Linux/Alpha
- From: Nick Clifton <nickc at redhat dot com>
- To: tsv at solvo dot ru
- Cc: binutils at sourceware dot org
- Date: Mon, 09 Jan 2006 17:19:03 +0000
- Subject: Re: Problem with -mcpu option for GAS on Linux/Alpha
- References: <43C16243.2030302@solvo.ru>
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