diff options
author | Richard Henderson <rth@redhat.com> | 2002-11-07 00:42:19 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2002-11-07 00:42:19 +0000 |
commit | 66ba4c770bbb930da59fce9e0fb788333815332f (patch) | |
tree | 8b6803d6cd71c7a066c72e7f711ec3cd37148de9 /gas/config | |
parent | 0067822234fcb91d5f944857d619d0718540f271 (diff) | |
download | gdb-66ba4c770bbb930da59fce9e0fb788333815332f.zip gdb-66ba4c770bbb930da59fce9e0fb788333815332f.tar.gz gdb-66ba4c770bbb930da59fce9e0fb788333815332f.tar.bz2 |
* config/tc-alpha.c (alpha_validate_fix): Move code ...
(alpha_fix_adjustable): ... here.
* config/tc-alpha.h (TC_VALIDATE_FIX): Remove.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-alpha.c | 77 | ||||
-rw-r--r-- | gas/config/tc-alpha.h | 4 |
2 files changed, 33 insertions, 48 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 0dc875b..7c8a00d 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1419,49 +1419,6 @@ alpha_define_label (sym) alpha_insn_label = sym; } -/* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and - let it get resolved at assembly time. */ - -#ifdef OBJ_ELF -void -alpha_validate_fix (f) - fixS *f; -{ - int offset = 0; - const char *name; - - if (f->fx_r_type != BFD_RELOC_ALPHA_BRSGP) - return; - - if (! S_IS_DEFINED (f->fx_addsy)) - return; - - switch (S_GET_OTHER (f->fx_addsy) & STO_ALPHA_STD_GPLOAD) - { - case STO_ALPHA_NOPV: - break; - case STO_ALPHA_STD_GPLOAD: - offset = 8; - break; - default: - if (S_IS_LOCAL (f->fx_addsy)) - name = "<local>"; - else - name = S_GET_NAME (f->fx_addsy); - as_bad_where (f->fx_file, f->fx_line, - _("!samegp reloc against symbol without .prologue: %s"), - name); - break; - } - - if (! (S_IS_EXTERN (f->fx_addsy) || S_IS_WEAK (f->fx_addsy))) - { - f->fx_r_type = BFD_RELOC_23_PCREL_S2; - f->fx_offset += offset; - } -} -#endif - /* Return true if we must always emit a reloc for a type and false if there is some hope of resolving it at assembly time. */ @@ -1521,7 +1478,6 @@ alpha_fix_adjustable (f) case BFD_RELOC_ALPHA_GPDISP_HI16: case BFD_RELOC_ALPHA_GPDISP_LO16: case BFD_RELOC_ALPHA_GPDISP: - case BFD_RELOC_ALPHA_BRSGP: return 0; case BFD_RELOC_ALPHA_LITERAL: @@ -1559,6 +1515,39 @@ alpha_fix_adjustable (f) we're preventing this in the other assemblers. Follow for now. */ return 0; + case BFD_RELOC_ALPHA_BRSGP: + /* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and + let it get resolved at assembly time. */ + { + symbolS *sym = f->fx_addsy; + const char *name; + int offset = 0; + + if (! S_IS_DEFINED (sym) || S_FORCE_RELOC (sym)) + return 0; + + switch (S_GET_OTHER (sym) & STO_ALPHA_STD_GPLOAD) + { + case STO_ALPHA_NOPV: + break; + case STO_ALPHA_STD_GPLOAD: + offset = 8; + break; + default: + if (S_IS_LOCAL (sym)) + name = "<local>"; + else + name = S_GET_NAME (sym); + as_bad_where (f->fx_file, f->fx_line, + _("!samegp reloc against symbol without .prologue: %s"), + name); + break; + } + f->fx_r_type = BFD_RELOC_23_PCREL_S2; + f->fx_offset += offset; + return 1; + } + default: return 1; } diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h index 50e4389..e126413 100644 --- a/gas/config/tc-alpha.h +++ b/gas/config/tc-alpha.h @@ -49,16 +49,12 @@ struct fix; struct alpha_reloc_tag; -extern void alpha_validate_fix PARAMS ((struct fix *)); extern int alpha_force_relocation PARAMS ((struct fix *)); extern int alpha_fix_adjustable PARAMS ((struct fix *)); extern unsigned long alpha_gprmask, alpha_fprmask; extern valueT alpha_gp_value; -#ifdef OBJ_ELF -#define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) alpha_validate_fix (FIX) -#endif #define TC_FORCE_RELOCATION(FIX) alpha_force_relocation (FIX) #define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX) #define RELOC_REQUIRES_SYMBOL |