diff options
author | Jeff Law <law@redhat.com> | 1993-11-30 21:43:15 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1993-11-30 21:43:15 +0000 |
commit | 335d35c8bc7d8983c69b2e1502d5db61f992b3f4 (patch) | |
tree | 99ca14e9d6be5fb6cb739911785437800b5fa366 /gas/config | |
parent | 1f44fb57ca94a53c37a56fd150c9e99a292f9be4 (diff) | |
download | gdb-335d35c8bc7d8983c69b2e1502d5db61f992b3f4.zip gdb-335d35c8bc7d8983c69b2e1502d5db61f992b3f4.tar.gz gdb-335d35c8bc7d8983c69b2e1502d5db61f992b3f4.tar.bz2 |
* write.c (TC_FORCE_RELOCATION): Provide a default definition.
(fixup_segment): Allow the target machine to specify that a
relocation must be generated for a particular fixup. Remove
#ifndef TC_HPPA hack.
* config/tc-hppa.h (TC_FORCE_RELOCATION): Define.
* config/tc-hppa.c (md_apply_fix_1): Never change fx_addsy to
be NULL. Only fixup_segment is supposed to do that.
(hppa_force_relocation): New function.
Diffstat (limited to 'gas/config')
-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; |