(md_apply_fix): Remove bad assert added 2000-09-26.

This commit is contained in:
Alan Modra 2000-10-07 14:38:32 +00:00
parent dc149a6d17
commit dc1fc56bde
2 changed files with 179 additions and 179 deletions

View File

@ -1,5 +1,8 @@
2000-10-07 Alan Modra <alan@linuxcare.com.au>
* config/tc-hppa.c (md_apply_fix): Remove plainly wrong assert.
Re-arrange function a little and improve error message.
* write.c (write_relocs): Fix a comment.
* config/obj-elf.c (elf_frob_symbol): Make section syms global on

View File

@ -4341,12 +4341,11 @@ md_apply_fix (fixP, valp)
fixS *fixP;
valueT *valp;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
unsigned char *buf;
struct hppa_fix_struct *hppa_fixP;
offsetT new_val;
int insn, val;
int insn, val, fmt;
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
/* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can
never be "applied" (they are just markers). Likewise for
R_HPPA_BEGIN_BRTAB and R_HPPA_END_BRTAB. */
@ -4373,14 +4372,19 @@ md_apply_fix (fixP, valp)
return 1;
#endif
insn = bfd_get_32 (stdoutput, (unsigned char *) buf);
/* There should have been an HPPA specific fixup associated
with the GAS fixup. */
if (hppa_fixP)
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
if (hppa_fixP == NULL)
{
int fmt = bfd_hppa_insn2fmt (stdoutput, insn);
printf (_("no hppa_fixup entry for fixup type 0x%x at %s:%d"),
fixP->fx_r_type, fixP->fx_file, fixP->fx_line);
return 0;
}
assert (fmt == hppa_fixP->fx_r_format);
buf = fixP->fx_frag->fr_literal + fixP->fx_where;
insn = bfd_get_32 (stdoutput, buf);
fmt = bfd_hppa_insn2fmt (stdoutput, insn);
/* If there is a symbol associated with this fixup, then it's something
which will need a SOM relocation (except for some PC-relative relocs).
@ -4402,7 +4406,7 @@ md_apply_fix (fixP, valp)
|| hppa_fixP->fx_r_field == e_rtsel
|| hppa_fixP->fx_r_field == e_ltsel)
new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0);
/* This is truely disgusting. The machine independent code blindly
/* This is truly disgusting. The machine independent code blindly
adds in the value of the symbol being relocated against. Damn! */
else if (fmt == 32
&& fixP->fx_addsy != NULL
@ -4545,16 +4549,9 @@ md_apply_fix (fixP, valp)
}
/* Insert the relocation. */
bfd_put_32 (stdoutput, insn, (unsigned char *) buf);
bfd_put_32 (stdoutput, insn, buf);
return 1;
}
else
{
printf (_("no hppa_fixup entry for this fixup (fixP = 0x%x, type = 0x%x)\n"),
(unsigned int) fixP, fixP->fx_r_type);
return 0;
}
}
/* Exactly what point is a PC-relative offset relative TO?
On the PA, they're relative to the address of the offset. */