+2017-01-11 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/78253
+ * config/arm/arm.c (legitimize_pic_address): Handle reference to
+ weak symbol.
+ (arm_assemble_integer): Likewise.
+
2017-01-11 Richard Earnshaw <rearnsha@arm.com>
* config.gcc: Use new awk script to check CPU, FPU and architecture
same segment as the GOT. Unfortunately, the flexibility of linker
scripts means that we can't be sure of that in general, so assume
that GOTOFF is never valid on VxWorks. */
+ /* References to weak symbols cannot be resolved locally: they
+ may be overridden by a non-weak definition at link time. */
rtx_insn *insn;
if ((GET_CODE (orig) == LABEL_REF
- || (GET_CODE (orig) == SYMBOL_REF &&
- SYMBOL_REF_LOCAL_P (orig)))
+ || (GET_CODE (orig) == SYMBOL_REF
+ && SYMBOL_REF_LOCAL_P (orig)
+ && (SYMBOL_REF_DECL (orig)
+ ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1)))
&& NEED_GOT_RELOC
&& arm_pic_data_is_text_relative)
insn = arm_pic_static_addr (orig, reg);
{
/* See legitimize_pic_address for an explanation of the
TARGET_VXWORKS_RTP check. */
+ /* References to weak symbols cannot be resolved locally:
+ they may be overridden by a non-weak definition at link
+ time. */
if (!arm_pic_data_is_text_relative
- || (GET_CODE (x) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (x)))
+ || (GET_CODE (x) == SYMBOL_REF
+ && (!SYMBOL_REF_LOCAL_P (x)
+ || (SYMBOL_REF_DECL (x)
+ ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0))))
fputs ("(GOT)", asm_out_file);
else
fputs ("(GOTOFF)", asm_out_file);