+2002-02-19 Philip Blundell <pb@nexus.co.uk>
+
+ * config/arm/arm.c (arm_encode_call_attribute): Operate on any
+ decl, not just FUNCTION_DECL.
+ (legitimize_pic_address): Handle local SYMBOL_REF like LABEL_REF.
+ (arm_assemble_integer): Likewise.
+ * config/arm/arm.h (ARM_ENCODE_CALL_TYPE): Allow any decl to be
+ marked local.
+
2002-02-19 matthew green <mrg@eterna.com.au>
* config.gcc (sparc-*-netbsdelf*): Enable target.
int len = strlen (str);
char * newstr;
- if (TREE_CODE (decl) != FUNCTION_DECL)
- return;
-
/* Do not allow weak functions to be treated as short call. */
if (DECL_WEAK (decl) && flag == SHORT_CALL_FLAG_CHAR)
return;
else
emit_insn (gen_pic_load_addr_thumb (address, orig));
- if (GET_CODE (orig) == LABEL_REF && NEED_GOT_RELOC)
+ if ((GET_CODE (orig) == LABEL_REF
+ || (GET_CODE (orig) == SYMBOL_REF &&
+ ENCODED_SHORT_CALL_ATTR_P (XSTR (orig, 0))))
+ && NEED_GOT_RELOC)
pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address);
else
{
if (NEED_GOT_RELOC && flag_pic && making_const_table &&
(GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF))
{
- if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
+ if (GET_CODE (x) == SYMBOL_REF
+ && (CONSTANT_POOL_ADDRESS_P (x)
+ || ENCODED_SHORT_CALL_ATTR_P (XSTR (x, 0))))
fputs ("(GOTOFF)", asm_out_file);
else if (GET_CODE (x) == LABEL_REF)
fputs ("(GOTOFF)", asm_out_file);
or known to be defined in this file then encode a short call flag.
This macro is used inside the ENCODE_SECTION macro. */
#define ARM_ENCODE_CALL_TYPE(decl) \
- if (TREE_CODE (decl) == FUNCTION_DECL) \
+ if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') \
{ \
- if (DECL_WEAK (decl)) \
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl)) \
arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR); \
else if (! TREE_PUBLIC (decl)) \
arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); \