The MSP430 target has a "430X" extension which increases the directly addressable memory range from 64KB (16-bit) to 1MB (20-bit). This 1MB memory range is split into a "lower" region (below address 0x10000) and "upper" region (at or above address 0x10000). When data in the upper region is addressed, 430 instructions cannot be used, as their 16-bit capability will be exceeded; 430X instructions must be used instead. Most 430X instructions require an additional word of op-code, and also require more cycles to execute compared to their 430 equivalent. Currently, when the large memory model is specified (-mlarge), 430X instructions will always be used when addressing a symbol_ref using the absolute addressing mode e.g. MOVX #1, &foo. The attached patch modifies code generation so that 430X instructions will only be used when the symbol being addressed will not be placed in the lower memory region. This is determined by checking if -mdata-region=lower (the new default) is passed, or if the "lower" attribute is set on the variable. Since code will be generated to assume all variables are in the lower memory region with -mdata-region=lower, object files built with this option cannot be linked with objects files built with other -mdata-region= values. To facilitate the checking of this, a patch for binutils (to be submitted after this is accepted) is also attached. The compiler will now generate assembler directives indicating the ISA, memory model and data region the source file was compiled with. The assembler will check these directives match the options it has been invoked with, and then add the attribute to the object file. Successfully regtested for msp430-elf in the small and large memory model, and with -mdata-region=upper. Testing with -mdata-region=upper should expose any cases where a 430X instruction is not used where it is required, since all data is forced into the upper region so a lack of 430X insn would cause a relocation overflow. In fact the attached patch fixes some relocation overflows by adding missing "%X" operand selectors to some insns. One relocation overflow remains (pr65077.c), but that is a separate binutils issue. Ok for trunk?