* write.c (write_relocs): Print some sensible error message if
bfd_perform_relocation returns bfd_reloc_overflow.
This commit is contained in:
parent
fa965415f5
commit
df44a8523f
|
@ -1,3 +1,13 @@
|
|||
Tue Feb 8 16:00:25 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* write.c (write_relocs): Print some sensible error message if
|
||||
bfd_perform_relocation returns bfd_reloc_overflow.
|
||||
|
||||
Mon Feb 7 15:49:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
|
||||
|
||||
* configure.in (hppa*-*elf*): New configuration for PA ELF.
|
||||
(hppa*-*-osf*): Default object format is SOM.
|
||||
|
||||
Mon Feb 7 16:07:35 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* config/tc-alpha.c (md_atof): Warn that floating-point values
|
||||
|
|
48
gas/write.c
48
gas/write.c
|
@ -683,6 +683,9 @@ write_relocs (abfd, sec, xxx)
|
|||
{
|
||||
case bfd_reloc_ok:
|
||||
break;
|
||||
case bfd_reloc_overflow:
|
||||
as_bad_where (fixp->fx_file, fixp->fx_line, "relocation overflow");
|
||||
break;
|
||||
default:
|
||||
as_fatal ("bad return from bfd_perform_relocation");
|
||||
}
|
||||
|
@ -2072,28 +2075,31 @@ fixup_segment (fixP, this_segment_type)
|
|||
if (!fixP->fx_bit_fixP && size > 0)
|
||||
{
|
||||
valueT mask = 0;
|
||||
/* set all bits to one */
|
||||
mask--;
|
||||
/* Technically, combining these produces an undefined result
|
||||
if size is sizeof (valueT), though I think these two
|
||||
half-way operations should both be defined. And the
|
||||
compiler should be able to combine them if it's valid on
|
||||
the host architecture. */
|
||||
mask <<= size * 4;
|
||||
mask <<= size * 4;
|
||||
if ((add_number & mask) != 0
|
||||
&& (add_number & mask) != mask)
|
||||
if (size < sizeof (mask))
|
||||
{
|
||||
char buf[50], buf2[50];
|
||||
sprint_value (buf, fragP->fr_address + where);
|
||||
if (add_number > 1000)
|
||||
sprint_value (buf2, add_number);
|
||||
else
|
||||
sprintf (buf2, "%ld", (long) add_number);
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line,
|
||||
"Value of %s too large for field of %d bytes at %s",
|
||||
buf2, size, buf);
|
||||
} /* generic error checking */
|
||||
/* set all bits to one */
|
||||
mask--;
|
||||
/* Technically, combining these produces an undefined result
|
||||
if size is sizeof (valueT), though I think these two
|
||||
half-way operations should both be defined. And the
|
||||
compiler should be able to combine them if it's valid on
|
||||
the host architecture. */
|
||||
mask <<= size * 4;
|
||||
mask <<= size * 4;
|
||||
if ((add_number & mask) != 0
|
||||
&& (add_number & mask) != mask)
|
||||
{
|
||||
char buf[50], buf2[50];
|
||||
sprint_value (buf, fragP->fr_address + where);
|
||||
if (add_number > 1000)
|
||||
sprint_value (buf2, add_number);
|
||||
else
|
||||
sprintf (buf2, "%ld", (long) add_number);
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line,
|
||||
"Value of %s too large for field of %d bytes at %s",
|
||||
buf2, size, buf);
|
||||
} /* generic error checking */
|
||||
}
|
||||
#ifdef WARN_SIGNED_OVERFLOW_WORD
|
||||
/* Warn if a .word value is too large when treated as a signed
|
||||
number. We already know it is not too negative. This is to
|
||||
|
|
Loading…
Reference in New Issue