From 121f460c882d2e62ca6dde72f7f6acedd7fa34d7 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 28 Jan 2013 22:15:59 +0000 Subject: Use symbolic_address_p() instead of simply checking whether GET_CODE() is SYMBOL_REF or LABEL_REF, when deciding to put #got_rel relocations. This allows (symbol + constant) to be correctly relocated when building PIC. --- gnu/usr.bin/gcc/gcc/config/m88k/m88k.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c index a97dfd5f184..86d664a3a87 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c @@ -2947,7 +2947,7 @@ print_operand (file, x, code) return; case 'g': /* append #got_rel as needed */ - if (flag_pic && (xc == SYMBOL_REF || xc == LABEL_REF)) + if (flag_pic && symbolic_address_p (x)) { output_addr_const (file, x); fputs ("#got_rel", file); @@ -2970,7 +2970,6 @@ print_operand_address (file, addr) rtx addr; { register rtx reg0, reg1; - enum rtx_code xc; switch (GET_CODE (addr)) { @@ -2987,8 +2986,7 @@ print_operand_address (file, addr) output_addr_const (file, XEXP (addr, 1)); if (flag_pic) { - xc = GET_CODE (XEXP (addr, 1)); - if (xc == SYMBOL_REF || xc == LABEL_REF) + if (symbolic_address_p (XEXP (addr, 1))) fputs ("#got_rel", file); } fputc (')', file); -- cgit v1.2.3