LoongArch: Add R_LARCH_64_PCREL relocation support
[binutils-gdb.git] / gas / write.h
index a69ec3cd17c5dc90e4c3e977d34435b56dfc04a4..eb30a76bf85ab21132999b131ad3a6650207a4c7 100644 (file)
@@ -1,5 +1,5 @@
 /* write.h
-   Copyright (C) 1987-2019 Free Software Foundation, Inc.
+   Copyright (C) 1987-2023 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
 #define FAKE_LABEL_CHAR '\001'
 #endif
 
-#include "bit_fix.h"
-
 /*
  * FixSs may be built up in any order.
  */
 
 struct fix
 {
+  /* Next fixS in linked list, or NULL.  */
+  struct fix *fx_next;
+
   /* These small fields are grouped together for compactness of
      this structure, and efficiency of access on some architectures.  */
 
-  /* Is this a pc-relative relocation?  */
-  unsigned fx_pcrel : 1;
+  /* pc-relative offset adjust (only used by some CPU specific code).
+     A 4-bit field would be sufficient for most uses, except for ppc
+     which pokes an operand table index here.  Bits may be stolen
+     from here should that be necessary, provided PPC_OPINDEX_MAX is
+     adjusted suitably.  */
+  int fx_pcrel_adjust : 16;
 
-  /* Is this value an immediate displacement?  */
-  /* Only used on ns32k; merge it into TC_FIX_TYPE sometime.  */
-  unsigned fx_im_disp : 2;
+  /* How many bytes are involved? */
+  unsigned fx_size : 8;
 
-  /* Some bits for the CPU specific code.  */
-  unsigned fx_tcbit : 1;
-  unsigned fx_tcbit2 : 1;
+  /* Is this a pc-relative relocation?  */
+  unsigned fx_pcrel : 1;
 
   /* Has this relocation already been applied?  */
   unsigned fx_done : 1;
@@ -75,11 +78,14 @@ struct fix
   /* The value is signed when checking for overflow.  */
   unsigned fx_signed : 1;
 
-  /* pc-relative offset adjust (only used by some CPU specific code) */
-  signed char fx_pcrel_adjust;
+  /* Some bits for the CPU specific code.  */
+  unsigned fx_tcbit : 1;
+  unsigned fx_tcbit2 : 1;
 
-  /* How many bytes are involved? */
-  unsigned char fx_size;
+  /* Spare bits.  */
+  unsigned fx_unused : 2;
+
+  bfd_reloc_code_real_type fx_r_type;
 
   /* Which frag does this fix apply to?  */
   fragS *fx_frag;
@@ -102,14 +108,6 @@ struct fix
   /* The frag fx_dot_value is based on.  */
   fragS *fx_dot_frag;
 
-  /* Next fixS in linked list, or NULL.  */
-  struct fix *fx_next;
-
-  /* If NULL, no bitfix's to do.  */
-  bit_fixS *fx_bit_fixP;
-
-  bfd_reloc_code_real_type fx_r_type;
-
   /* This field is sort of misnamed.  It appears to be a sort of random
      scratch field, for use by the back ends.  The main gas code doesn't
      do anything but initialize it to zero.  The use of it does need to
@@ -190,5 +188,6 @@ extern fixS *fix_at_start (fragS *, unsigned long, symbolS *,
 extern fixS *fix_new_exp (fragS *, unsigned long, unsigned long,
                          expressionS *, int, bfd_reloc_code_real_type);
 extern void write_print_statistics (FILE *);
+extern void as_bad_subtract (fixS *);
 
 #endif /* __write_h__ */