diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-01-28 22:15:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-01-28 22:15:59 +0000 |
commit | 121f460c882d2e62ca6dde72f7f6acedd7fa34d7 (patch) | |
tree | 3ac2e5d1d8803eef0bb9862a394a74f984c213ce /gnu/usr.bin/gcc | |
parent | d469a4ce3967ec04cbb7e82a0e474e15748976bf (diff) |
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.
Diffstat (limited to 'gnu/usr.bin/gcc')
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.c | 6 |
1 files 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); |