diff options
Diffstat (limited to 'gas/config/tc-hppa.c')
-rw-r--r-- | gas/config/tc-hppa.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index e588ca8..6ee3ac2 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -3102,7 +3102,6 @@ md_apply_fix_1 (fixP, val) dis_assemble_12 (result, &w1, &w); result = ((w1 << 2) | w); - fixP->fx_addsy = NULL; break; #define stub_needed(CALLER, CALLEE) \ @@ -3129,7 +3128,6 @@ md_apply_fix_1 (fixP, val) sign_unext ((new_val - 8) >> 2, 17, &result); dis_assemble_17 (result, &w1, &w2, &w); result = ((w2 << 2) | (w1 << 16) | w); - fixP->fx_addsy = NULL; break; #undef too_far @@ -6346,6 +6344,39 @@ hppa_fix_adjustable (fixp) return 0; } +/* Return nonzero if the fixup in FIXP will require a relocation, + even it if appears that the fixup could be completely handled + within GAS. */ + +int +hppa_force_relocation (fixp) + fixS *fixp; +{ + struct hppa_fix_struct *hppa_fixp = fixp->tc_fix_data; + +#ifdef OBJ_SOM + if (fixp->fx_r_type == R_HPPA_ENTRY || fixp->fx_r_type == R_HPPA_EXIT) + return 1; +#endif + +#define stub_needed(CALLER, CALLEE) \ + ((CALLEE) && (CALLER) && ((CALLEE) != (CALLER))) + + /* It is necessary to force PC-relative calls/jumps to have a relocation + entry if they're going to need either a argument relocation or long + call stub. FIXME. Can't we need the same for absolute calls? */ + if (fixp->fx_pcrel + && (stub_needed (((obj_symbol_type *) + fixp->fx_addsy->bsym)->tc_data.hppa_arg_reloc, + hppa_fixp->fx_arg_reloc))) + return 1; + +#undef stub_needed + + /* No need (yet) to force another relocations to be emitted. */ + return 0; +} + /* Now for some ELF specific code. FIXME. */ #ifdef OBJ_ELF static symext_chainS *symext_rootP; |