aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in2.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-22 18:03:51 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-22 18:03:51 +0000
commit66a277abe2b75c998a0549c7818e8c10e5f6be31 (patch)
treec7044e5652bcb27c59a438f234a4c33989cb3d52 /bfd/bfd-in2.h
parentc2ac84cbbc67569776217765d2bccadbfac07e1f (diff)
downloadgdb-66a277abe2b75c998a0549c7818e8c10e5f6be31.zip
gdb-66a277abe2b75c998a0549c7818e8c10e5f6be31.tar.gz
gdb-66a277abe2b75c998a0549c7818e8c10e5f6be31.tar.bz2
* reloc.c (enum complain_overflow): New enumeration with the
various flavours of overflow checking. (srtuct reloc_howto_struct): Changed complain_on_overflow field from boolean to emum complain_overflow. Removed obsolete absolute field. (HOWTO): Removed absolute argument. (bfd_perform_relocation): Do overflow checking on all types of fields. * bfd-in2.h: Updated accordingly. * all targets: Updated initialization of reloc howto tables.
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r--bfd/bfd-in2.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 276e051..720c595 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -955,6 +955,23 @@ typedef struct reloc_cache_entry
CONST struct reloc_howto_struct *howto;
} arelent;
+enum complain_overflow
+{
+ /* Do not complain on overflow. */
+ complain_overflow_dont,
+
+ /* Complain if the bitfield overflows, whether it is considered
+ as signed or unsigned. */
+ complain_overflow_bitfield,
+
+ /* Complain if the value overflows when considered as signed
+ number. */
+ complain_overflow_signed,
+
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
+ complain_overflow_unsigned
+};
typedef CONST struct reloc_howto_struct
{
@@ -975,7 +992,8 @@ typedef CONST struct reloc_howto_struct
result is to be subtracted from the data. */
int size;
- /* Now obsolete? But m68k-coff still uses it... */
+ /* The number of bits in the item to be relocated. This is used
+ when doing overflow checking. */
unsigned int bitsize;
/* Notes that the relocation is relative to the location in the
@@ -984,14 +1002,13 @@ typedef CONST struct reloc_howto_struct
being relocated. */
boolean pc_relative;
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
unsigned int bitpos;
- /* Now obsolete */
- boolean absolute;
-
- /* Causes the relocation routine to return an error if overflow
- is detected when relocating. */
- boolean complain_on_overflow;
+ /* What type of overflow error should be checked for when
+ relocating. */
+ enum complain_overflow complain_on_overflow;
/* If this field is non null, then the supplied function is
called rather than the normal function. This allows really
@@ -1036,9 +1053,9 @@ typedef CONST struct reloc_howto_struct
boolean pcrel_offset;
} reloc_howto_type;
-#define HOWTO(C, R,S,B, P, BI, ABS, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
- {(unsigned)C,R,S,B, P, BI, ABS,O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
-#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,false,false,FUNCTION, NAME,false,0,0,IN)
+#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
+ {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
+#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
#define HOWTO_PREPARE(relocation, symbol) \
{ \