aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-hppa.c
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2008-08-28 02:33:45 +0000
committerDave Anglin <dave.anglin@nrc.ca>2008-08-28 02:33:45 +0000
commit6bba1048d63e0476b94b9934527defd81c590a13 (patch)
tree1ebc01000f49db0a5455491b1a0239466f7042a6 /gas/config/tc-hppa.c
parent3c045627c6d3bbf0e893d0f694a83ad8180db8bf (diff)
downloadgdb-6bba1048d63e0476b94b9934527defd81c590a13.zip
gdb-6bba1048d63e0476b94b9934527defd81c590a13.tar.gz
gdb-6bba1048d63e0476b94b9934527defd81c590a13.tar.bz2
* elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
R_PARISC_SEGREL32 and R_PARISC_SEGREL64. * som.c (som_fixup_formats): Add R_DATA_GPREL fixup. (som_hppa_howto_table): Likewise. (hppa_som_gen_reloc_type): In case R_HPPA_GOTOFF, detect R_DATA_GPREL final type. (som_write_fixups): Handle R_DATA_GPREL. * config/tc-hppa.c (is_SB_relative): New macro. (fix_new_hppa): Remove $segrel$ marker. (cons_fix_new_hppa): Set reloc type R_PARISC_SEGREL32 if expression is segment relative. * config/tc-hppa.h (tc_frob_symbol): Check for $segrel$.
Diffstat (limited to 'gas/config/tc-hppa.c')
-rw-r--r--gas/config/tc-hppa.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 5f6efbd..da84526 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1050,6 +1050,10 @@ static struct default_space_dict pa_def_spaces[] =
((exp).X_op == O_subtract \
&& strcmp (S_GET_NAME ((exp).X_op_symbol), "$global$") == 0)
+#define is_SB_relative(exp) \
+ ((exp).X_op == O_subtract \
+ && strcmp (S_GET_NAME ((exp).X_op_symbol), "$segrel$") == 0)
+
#define is_PC_relative(exp) \
((exp).X_op == O_subtract \
&& strcmp (S_GET_NAME ((exp).X_op_symbol), "$PIC_pcrel$0") == 0)
@@ -1233,6 +1237,7 @@ fix_new_hppa (fragS *frag,
it now so as not to confuse write.c. Ditto for $PIC_pcrel$0. */
if (new_fix->fx_subsy
&& (strcmp (S_GET_NAME (new_fix->fx_subsy), "$global$") == 0
+ || strcmp (S_GET_NAME (new_fix->fx_subsy), "$segrel$") == 0
|| strcmp (S_GET_NAME (new_fix->fx_subsy), "$PIC_pcrel$0") == 0
|| strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_gdidx$") == 0
|| strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_ldidx$") == 0
@@ -1256,6 +1261,8 @@ cons_fix_new_hppa (fragS *frag, int where, int size, expressionS *exp)
else if (is_PC_relative (*exp))
rel_type = R_HPPA_PCREL_CALL;
#ifdef OBJ_ELF
+ else if (is_SB_relative (*exp))
+ rel_type = R_PARISC_SEGREL32;
else if (is_tls_gdidx (*exp))
rel_type = R_PARISC_TLS_GD21L;
else if (is_tls_ldidx (*exp))