Switch the reloc type to GOT32 earlier, and do not permit GOT32 relocs to be

turned into section-relative relocs.
This commit is contained in:
mycroft 1998-12-04 17:22:52 +00:00
parent c10f6edafc
commit 79410cf933
2 changed files with 19 additions and 17 deletions

View File

@ -5066,8 +5066,9 @@ md_apply_fix3 (fixP, val, seg)
md_number_to_chars (buf, value, 2);
break;
case BFD_RELOC_RVA:
case BFD_RELOC_32:
case BFD_RELOC_RVA:
case BFD_RELOC_ARM_GOT32:
if (fixP->fx_done || fixP->fx_pcrel)
md_number_to_chars (buf, value, 4);
break;
@ -5279,9 +5280,6 @@ tc_gen_reloc (section, fixp)
case BFD_RELOC_32:
if (pic_code && fixp->fx_pcrel == 0 && fixp->fx_addsy != NULL)
{
if (section == text_section)
code = BFD_RELOC_ARM_GOT32;
else
code = fixp->fx_r_type;
break;
}
@ -5297,7 +5295,9 @@ tc_gen_reloc (section, fixp)
code = BFD_RELOC_ARM_JMPSLOT;
break;
}
case BFD_RELOC_RVA:
case BFD_RELOC_ARM_GOT32:
code = fixp->fx_r_type;
break;
@ -6144,22 +6144,22 @@ cons_fix_new_arm(frag, where, size, exp)
* and a 32 bit size
*/
if (pic_code != 0 && size == 4 && exp->X_op == O_add
&& exp->X_add_symbol
if (pic_code != 0 && size == 4 && exp->X_add_symbol)
{
if (exp->X_op == O_add
&& S_GET_SEGMENT (exp->X_add_symbol) == undefined_section
&& exp->X_op_symbol
&& S_GET_SEGMENT (exp->X_op_symbol) == expr_section)
{
/*
* This could be it
* Is the primary symbol name "__GLOBAL_OFFSET_TABLE" ?
*/
if (strcmp (S_GET_NAME(exp->X_add_symbol),
&& S_GET_SEGMENT (exp->X_op_symbol) == expr_section
&& strcmp (S_GET_NAME(exp->X_add_symbol),
GLOBAL_OFFSET_TABLE_NAME) == 0)
{
type = BFD_RELOC_ARM_GOTPC;
pcrel = 1;
}
else if (exp->X_op == O_symbol)
{
type = BFD_RELOC_ARM_GOT32;
}
}
fix_new_exp (frag, where, (int) size, exp, pcrel, type);

View File

@ -71,7 +71,9 @@
#define md_start_line_hook() arm_start_line_hook ()
#define tc_frob_label(S) arm_frob_label (S)
/*#define obj_fix_adjustable(fixP) */ /* get this from obj-aout.h */
/* adjust_reloc_syms doesn't know about the GOT */
#define tc_fix_adjustable(fixP) \
((fixP)->fx_r_type != BFD_RELOC_ARM_GOT32)
#define TC_FIX_TYPE PTR
#define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)