[PATCH] ARM attributes and user intent

Andrew Stubbs ams@codesourcery.com
Wed Jan 21 11:08:00 GMT 2009


Hi,

The ARM ABI requires that the attributes are set according to the intent 
of the user, not the state of the binary (the two must be compatible, of 
course).

With this patch, the attributes are now set according to the following 
rules:

1. If no options or directives are present, then the assembler assumes 
the user intends no specific architecture, but assumes the user intends 
that both ARM and Thumb are permitted. (This is the assumption made by 
the assembler when validating the input.)

2. If no directives are present, but command line options are given, 
then the user intentions are specified by the options.

3. If directives are present, then those encode the user intentions, 
regardless of the command line options, or code content.

4. The .eabi_attributes set the output values of the attributes, and 
override .cpu, .arch, .fpu, and command line settings (i.e. any 
auto-magical settings). The .cpu, .arch,  .fpu, and command line 
settings continue to control the assembler's validation checks.

5. Attributes not set explicitly are inferred (where possible) from the 
user intentions determined above.

Note that the compiler passes the user intentions through as .cpu and 
.fpu directives.


In the process of this work I also found and fixed a number of bugs:

* The iwmmxt2 was not set correctly.

* The FPU was settings for VFPv3 and VFPv3-D16 were inverted.

* -march=armv5t resulted in v5te


The patch adds a test case for every possible -march and -mfpu to ensure 
that the attributes are set correctly, and a number of test cases to 
ensure that the precedence rules above are obeyed. I have also updated 
the expected results for all affected existing tests.

OK?

Andrew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: user_intent.patch
Type: text/x-diff
Size: 68497 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090121/e48626c3/attachment.bin>


More information about the Binutils mailing list