Get rid of the -1 dummy valued enum in START_RELOC_NUMBERS.
authorAlan Modra <amodra@gmail.com>
Wed, 7 Jun 2000 03:43:33 +0000 (03:43 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 7 Jun 2000 03:43:33 +0000 (03:43 +0000)
Remove duplicate reloc enums in elf32-d[13]0v.c
Remove EMPTY_HOWTOs in elf32-i386.c

30 files changed:
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/elf32-d10v.c
bfd/elf32-d30v.c
bfd/elf32-i386.c
include/elf/ChangeLog
include/elf/alpha.h
include/elf/arc.h
include/elf/arm.h
include/elf/avr.h
include/elf/d10v.h
include/elf/d30v.h
include/elf/fr30.h
include/elf/hppa.h
include/elf/i386.h
include/elf/i960.h
include/elf/ia64.h
include/elf/m32r.h
include/elf/m68k.h
include/elf/mcore.h
include/elf/mips.h
include/elf/mn10200.h
include/elf/mn10300.h
include/elf/pj.h
include/elf/ppc.h
include/elf/reloc-macros.h
include/elf/sh.h
include/elf/sparc.h
include/elf/v850.h

index 6df6346e0507612cecfab390c42dc909ca828a33..d0f4584c8368200a0a5382370b8974f0faf2f046 100644 (file)
@@ -1,3 +1,20 @@
+2000-06-07  Alan Modra  <alan@linuxcare.com.au>
+
+       * elf32-d10v.c: Include elf/d10v.h
+       (enum reloc_type): Delete.
+       * elf32-d30v.c: Include elf/d30v.h
+       (enum reloc_type): Delete.
+
+       * Makefile.am: Run "make dep-am" to regenerate dependencies.
+       * Makefile.in: Regenerate.
+
+       * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs.
+       (R_386_standard, R_386_ext_offset): Define.
+       (elf_i386_reloc_type_lookup): Modify calculation of index into
+       elf_howto_table since we've removed the gap.
+       (elf_i386_info_to_howto_rel): Likewise.
+       (elf_i386_relocate_section): Likewise.
+
 2000-06-06  Michael Snyder  <msnyder@seadog.cygnus.com>
 
        * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t.
index 380b993f2692b5c5ff15ed28c2bc8b63cd57533c..1b6a0a77c72c69c4cf46b96f1b5e58a0801d13e8 100644 (file)
@@ -900,10 +900,12 @@ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
   elf32-target.h
 elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/bfdlink.h elf32-target.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/bfdlink.h elf32-target.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \
index 3192f328f4a1f0971274261a8cceca0948a07e2c..f23960a6b7a9c0698d1f1e22f78a4521260b4d2b 100644 (file)
@@ -1428,10 +1428,12 @@ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
   elf32-target.h
 elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/bfdlink.h elf32-target.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/bfdlink.h elf32-target.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \
index dd2e892ad0862dcbb6e4d1effbe627d0d69f21ca..3fbf05b227b109bce0965f9b2503441cd6ade5d8 100644 (file)
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
-/* #include "elf/d10v.h" */
+#include "elf/d10v.h"
 
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
@@ -33,20 +33,6 @@ static void d10v_info_to_howto_rel
 /* Use REL instead of RELA to save space */
 #define USE_REL
 
-enum reloc_type
-{
-  R_D10V_NONE = 0,
-  R_D10V_10_PCREL_R,
-  R_D10V_10_PCREL_L,
-  R_D10V_16,
-  R_D10V_18,
-  R_D10V_18_PCREL,
-  R_D10V_32,
-  R_D10V_GNU_VTINHERIT,
-  R_D10V_GNU_VTENTRY,
-  R_D10V_max
-};
-
 static reloc_howto_type elf_d10v_howto_table[] =
 {
   /* This reloc does nothing.  */
index 52bafb99af75a812eb7fa5fb7ace2c6db0bb64b7..c7fde2b4651f3e261ee28c51471633a1d195ad62 100644 (file)
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
+#include "elf/d30v.h"
 
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
@@ -46,24 +47,6 @@ static bfd_reloc_status_type bfd_elf_d30v_reloc_21 PARAMS ((
      bfd *output_bfd,
      char **error_message));
 
-enum reloc_type
-{
-  R_D30V_NONE = 0,
-  R_D30V_6,
-  R_D30V_9_PCREL,
-  R_D30V_9_PCREL_R,
-  R_D30V_15,
-  R_D30V_15_PCREL,
-  R_D30V_15_PCREL_R,
-  R_D30V_21,
-  R_D30V_21_PCREL,
-  R_D30V_21_PCREL_R,
-  R_D30V_32,
-  R_D30V_32_PCREL,
-  R_D30V_32_NORMAL,
-  R_D30V_max
-};
-
 static reloc_howto_type elf_d30v_howto_table[] =
 {
   /* This reloc does nothing.  */
index 53edaaf254381a0f6a78705b6672f0bf4e64dac0..1a12571226453f44dfe35f1ea87cb9dc46449a76 100644 (file)
@@ -56,31 +56,56 @@ static boolean elf_i386_finish_dynamic_sections
 
 static reloc_howto_type elf_howto_table[]=
 {
-  HOWTO(R_386_NONE,     0,0, 0,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_NONE",     true,0x00000000,0x00000000,false),
-  HOWTO(R_386_32,       0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_32",       true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_PC32,     0,2,32,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC32",     true,0xffffffff,0xffffffff,true),
-  HOWTO(R_386_GOT32,    0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOT32",    true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_PLT32,    0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PLT32",    true,0xffffffff,0xffffffff,true),
-  HOWTO(R_386_COPY,      0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_COPY",            true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_GLOB_DAT,  0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GLOB_DAT", true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_JUMP_SLOT, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_JUMP_SLOT",true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_RELATIVE,  0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_GOTOFF,    0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF",   true,0xffffffff,0xffffffff,false),
-  HOWTO(R_386_GOTPC,     0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC",    true,0xffffffff,0xffffffff,true),
-  EMPTY_HOWTO (11),
-  EMPTY_HOWTO (12),
-  EMPTY_HOWTO (13),
-  EMPTY_HOWTO (14),
-  EMPTY_HOWTO (15),
-  EMPTY_HOWTO (16),
-  EMPTY_HOWTO (17),
-  EMPTY_HOWTO (18),
-  EMPTY_HOWTO (19),
+  HOWTO(R_386_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_NONE",
+       true, 0x00000000, 0x00000000, false),
+  HOWTO(R_386_32, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_32",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_PC32",
+       true, 0xffffffff, 0xffffffff, true),
+  HOWTO(R_386_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_GOT32",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_PLT32",
+       true, 0xffffffff, 0xffffffff, true),
+  HOWTO(R_386_COPY, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_COPY",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_GLOB_DAT, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_GLOB_DAT",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_JUMP_SLOT, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_JUMP_SLOT",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_RELATIVE, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_RELATIVE",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_GOTOFF, 0, 2, 32, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_GOTOFF",
+       true, 0xffffffff, 0xffffffff, false),
+  HOWTO(R_386_GOTPC, 0, 2, 32, true, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_GOTPC",
+       true, 0xffffffff, 0xffffffff, true),
+
+#define R_386_standard ((unsigned int) R_386_GOTPC + 1)
+#define R_386_ext_offset ((unsigned int) R_386_16 - R_386_standard)
+
   /* The remaining relocs are a GNU extension.  */
-  HOWTO(R_386_16,       0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16",       true,0xffff,0xffff,false),
-  HOWTO(R_386_PC16,     0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16",     true,0xffff,0xffff,true),
-  HOWTO(R_386_8,        0,0,8,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_8",         true,0xff,0xff,false),
-  HOWTO(R_386_PC8,      0,0,8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc,"R_386_PC8",         true,0xff,0xff,true),
+  HOWTO(R_386_16, 0, 1, 16, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_16",
+       true, 0xffff, 0xffff, false),
+  HOWTO(R_386_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_PC16",
+       true, 0xffff, 0xffff, true),
+  HOWTO(R_386_8, 0, 0, 8, false, 0, complain_overflow_bitfield,
+       bfd_elf_generic_reloc, "R_386_8",
+       true, 0xff, 0xff, false),
+  HOWTO(R_386_PC8, 0, 0, 8, true, 0, complain_overflow_signed,
+       bfd_elf_generic_reloc, "R_386_PC8",
+       true, 0xff, 0xff, true)
 };
 
 /* GNU extension to record C++ vtable hierarchy.  */
@@ -130,68 +155,68 @@ elf_i386_reloc_type_lookup (abfd, code)
     {
     case BFD_RELOC_NONE:
       TRACE ("BFD_RELOC_NONE");
-      return &elf_howto_table[ (int)R_386_NONE ];
+      return &elf_howto_table[(unsigned int) R_386_NONE ];
 
     case BFD_RELOC_32:
       TRACE ("BFD_RELOC_32");
-      return &elf_howto_table[ (int)R_386_32 ];
+      return &elf_howto_table[(unsigned int) R_386_32 ];
 
     case BFD_RELOC_CTOR:
       TRACE ("BFD_RELOC_CTOR");
-      return &elf_howto_table[ (int)R_386_32 ];
+      return &elf_howto_table[(unsigned int) R_386_32 ];
 
     case BFD_RELOC_32_PCREL:
       TRACE ("BFD_RELOC_PC32");
-      return &elf_howto_table[ (int)R_386_PC32 ];
+      return &elf_howto_table[(unsigned int) R_386_PC32 ];
 
     case BFD_RELOC_386_GOT32:
       TRACE ("BFD_RELOC_386_GOT32");
-      return &elf_howto_table[ (int)R_386_GOT32 ];
+      return &elf_howto_table[(unsigned int) R_386_GOT32 ];
 
     case BFD_RELOC_386_PLT32:
       TRACE ("BFD_RELOC_386_PLT32");
-      return &elf_howto_table[ (int)R_386_PLT32 ];
+      return &elf_howto_table[(unsigned int) R_386_PLT32 ];
 
     case BFD_RELOC_386_COPY:
       TRACE ("BFD_RELOC_386_COPY");
-      return &elf_howto_table[ (int)R_386_COPY ];
+      return &elf_howto_table[(unsigned int) R_386_COPY ];
 
     case BFD_RELOC_386_GLOB_DAT:
       TRACE ("BFD_RELOC_386_GLOB_DAT");
-      return &elf_howto_table[ (int)R_386_GLOB_DAT ];
+      return &elf_howto_table[(unsigned int) R_386_GLOB_DAT ];
 
     case BFD_RELOC_386_JUMP_SLOT:
       TRACE ("BFD_RELOC_386_JUMP_SLOT");
-      return &elf_howto_table[ (int)R_386_JUMP_SLOT ];
+      return &elf_howto_table[(unsigned int) R_386_JUMP_SLOT ];
 
     case BFD_RELOC_386_RELATIVE:
       TRACE ("BFD_RELOC_386_RELATIVE");
-      return &elf_howto_table[ (int)R_386_RELATIVE ];
+      return &elf_howto_table[(unsigned int) R_386_RELATIVE ];
 
     case BFD_RELOC_386_GOTOFF:
       TRACE ("BFD_RELOC_386_GOTOFF");
-      return &elf_howto_table[ (int)R_386_GOTOFF ];
+      return &elf_howto_table[(unsigned int) R_386_GOTOFF ];
 
     case BFD_RELOC_386_GOTPC:
       TRACE ("BFD_RELOC_386_GOTPC");
-      return &elf_howto_table[ (int)R_386_GOTPC ];
+      return &elf_howto_table[(unsigned int) R_386_GOTPC ];
 
       /* The remaining relocs are a GNU extension.  */
     case BFD_RELOC_16:
       TRACE ("BFD_RELOC_16");
-      return &elf_howto_table[(int) R_386_16];
+      return &elf_howto_table[(unsigned int) R_386_16 - R_386_ext_offset];
 
     case BFD_RELOC_16_PCREL:
       TRACE ("BFD_RELOC_16_PCREL");
-      return &elf_howto_table[(int) R_386_PC16];
+      return &elf_howto_table[(unsigned int) R_386_PC16 - R_386_ext_offset];
 
     case BFD_RELOC_8:
       TRACE ("BFD_RELOC_8");
-      return &elf_howto_table[(int) R_386_8];
+      return &elf_howto_table[(unsigned int) R_386_8 - R_386_ext_offset];
 
     case BFD_RELOC_8_PCREL:
       TRACE ("BFD_RELOC_8_PCREL");
-      return &elf_howto_table[(int) R_386_PC8];
+      return &elf_howto_table[(unsigned int) R_386_PC8 - R_386_ext_offset];
 
     case BFD_RELOC_VTABLE_INHERIT:
       TRACE ("BFD_RELOC_VTABLE_INHERIT");
@@ -231,14 +256,19 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst)
     cache_ptr->howto = &elf32_i386_vtinherit_howto;
   else if (type == R_386_GNU_VTENTRY)
     cache_ptr->howto = &elf32_i386_vtentry_howto;
-  else if (type < R_386_max
-          && (type < FIRST_INVALID_RELOC || type > LAST_INVALID_RELOC))
-    cache_ptr->howto = &elf_howto_table[(int) type];
   else
     {
-      (*_bfd_error_handler) (_("%s: invalid relocation type %d"),
-                            bfd_get_filename (abfd), (int) type);
-      cache_ptr->howto = &elf_howto_table[(int) R_386_NONE];
+      unsigned int indx;
+
+      if ((indx = (unsigned int) type) >= R_386_standard
+         && ((indx = (unsigned int) type - R_386_ext_offset)
+             >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0])))
+       {
+         (*_bfd_error_handler) (_("%s: invalid relocation type %d"),
+                                bfd_get_filename (abfd), (int) type);
+         indx = (unsigned int) R_386_NONE;
+       }
+      cache_ptr->howto = &elf_howto_table[indx];
     }
 }
 
@@ -1283,20 +1313,20 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
       asection *sec;
       bfd_vma relocation;
       bfd_reloc_status_type r;
+      unsigned int indx;
 
       r_type = ELF32_R_TYPE (rel->r_info);
       if (r_type == R_386_GNU_VTINHERIT
          || r_type == R_386_GNU_VTENTRY)
        continue;
-      if (r_type < 0
-         || r_type >= (int) R_386_max
-         || (r_type >= (int) FIRST_INVALID_RELOC
-             && r_type <= (int) LAST_INVALID_RELOC))
+      if ((indx = (unsigned) r_type) >= R_386_standard
+         && ((indx = (unsigned) r_type - R_386_ext_offset)
+             >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0])))
        {
          bfd_set_error (bfd_error_bad_value);
          return false;
        }
-      howto = elf_howto_table + r_type;
+      howto = elf_howto_table + indx;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
 
index ecbae349f55d10bc351b4e4009f81ba2a667eae4..521bd808c124675f2c1f205d67df88b0bff8b101 100644 (file)
@@ -1,3 +1,38 @@
+2000-06-06  Alan Modra  <alan@linuxcare.com.au>
+
+       * reloc-macros.h (START_RELOC_NUMBERS): Don't define initial dummy
+       -1 valued enum.
+       (RELOC_NUMBER, FAKE_RELOC, EMPTY_RELOC): Append rather than
+       prepend comma.
+       (END_RELOC_NUMBERS): Give macro an arg to define as last enum.
+
+       * alpha.h (R_ALPHA_max): Define via END_RELOC_NUMBERS rather than
+       with EMPTY_RELOC.
+       * arc.h (R_ARC_max): Likewise.
+       * avr.h (R_AVR_max): Likewise.
+       * fr30.h (R_FR30_max): Likewise.
+       * hppa.h (R_PARISC_UNIMPLEMENTED): Likewise.
+       * i960.h (R_960_max): Likewise.
+       * m32r.h (R_M32R_max): Likewise.
+       * m68k.h (R_68K_max): Likewise.
+       * mcore.h (R_MCORE_max): Likewise.
+       * mn10300.h (R_MN10300_MAX): Likewise.
+       * pj.h (R_PJ_max): Likewise.
+       * ppc.h (R_PPC_max): Likewise.
+       * sh.h (R_SH_max): Likewise.
+       * sparc.h (R_SPARC_max): Likewise.
+       * v850.h (R_V850_max): Likewise.
+
+       * arm.h (R_ARM_max): Define via END_RELOC_NUMBERS.
+       * d10v.h (R_D10V_max): Likewise.
+       * d30v.h (R_D30V_max): Likewise.
+       * ia64.h (R_IA64_max): Likewise.
+       * mips.h (R_MIPS_maxext): Likewise.
+       * mn10200.h (R_MN10200_max): Likewise.
+
+       * i386.h (R_386_max): Remove old RELOC_NUMBER definition, and
+       define via END_RELOC_NUMBERS.
+
 2000-06-03  Alan Modra  <alan@linuxcare.com.au>
 
        * reloc-macros.h (START_RELOC_NUMBERS): Fix name clash for
index 1ae9d5efd6d5e57a7da19fe642baea7810b1b920..1f6b377c4b6a9a1ed85f9817bf9e475c6a4ec9f3 100644 (file)
@@ -102,7 +102,6 @@ START_RELOC_NUMBERS (elf_alpha_reloc_type)
   RELOC_NUMBER (R_ALPHA_JMP_SLOT, 26)  /* Create PLT entry */
   RELOC_NUMBER (R_ALPHA_RELATIVE, 27)  /* Adjust by program base */
 
-  EMPTY_RELOC  (R_ALPHA_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_ALPHA_max)
 
 #endif /* _ELF_ALPHA_H */
index 334b55fa6d0f8c4bf6c2463c776b1d06f008f283..c552bf09d34a9af5b9fda586e7b05482abcb268d 100644 (file)
@@ -31,8 +31,7 @@ START_RELOC_NUMBERS (elf_arc_reloc_type)
   RELOC_NUMBER (R_ARC_32, 1)
   RELOC_NUMBER (R_ARC_B26, 2)
   RELOC_NUMBER (R_ARC_B22_PCREL, 3)
-  EMPTY_RELOC  (R_ARC_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_ARC_max)
 
 /* Processor specific flags for the ELF header e_flags field.  */
 
index 04c46dea6d61a1c5a452d1189f399fb0629524fe..049925185fac614bc78de82956a70f2105f4ee2d 100644 (file)
@@ -124,6 +124,6 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
   RELOC_NUMBER (R_ARM_RABS32,         253)
   RELOC_NUMBER (R_ARM_RPC24,          254)
   RELOC_NUMBER (R_ARM_RBASE,          255)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_ARM_max)
 
 #endif /* _ELF_ARM_H */
index 1527455995eda2befa198b3df63cb02281cb8146..c4cb860f30012d8302582488f901cd9c40fc47a8 100644 (file)
@@ -52,7 +52,6 @@ START_RELOC_NUMBERS (elf_avr_reloc_type)
      RELOC_NUMBER (R_AVR_HI8_LDI_PM_NEG,       16)
      RELOC_NUMBER (R_AVR_HH8_LDI_PM_NEG,       17)
      RELOC_NUMBER (R_AVR_CALL,                18)
-     EMPTY_RELOC  (R_AVR_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_AVR_max)
 
 #endif /* _ELF_AVR_H */
index 63b79c801b1fb11db3785ad9527c8912b0278500..2e3275074320937c43b90f4a01f98863ebe8ec06 100644 (file)
@@ -33,6 +33,6 @@ START_RELOC_NUMBERS (elf_d10v_reloc_type)
   RELOC_NUMBER (R_D10V_32, 6)
   RELOC_NUMBER (R_D10V_GNU_VTINHERIT, 7)
   RELOC_NUMBER (R_D10V_GNU_VTENTRY, 8)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_D10V_max)
 
 #endif
index adbad192325c0de7fd0c9978e5f072976a32d3df..c0f3bc86a5deecd5dc2e092acdacccd796a3461f 100644 (file)
@@ -37,6 +37,6 @@ START_RELOC_NUMBERS (elf_d30v_reloc_type)
   RELOC_NUMBER (R_D30V_32, 10)
   RELOC_NUMBER (R_D30V_32_PCREL, 11)
   RELOC_NUMBER (R_D30V_32_NORMAL, 12)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_D30V_max)
 
 #endif
index 223b052973aadee803384aae6bb3980edbba1e21..65ca907559751a75125361ad161f711616b65222 100644 (file)
@@ -37,7 +37,6 @@ START_RELOC_NUMBERS (elf_fr30_reloc_type)
   RELOC_NUMBER (R_FR30_12_PCREL, 10)
   RELOC_NUMBER (R_FR30_GNU_VTINHERIT, 11)
   RELOC_NUMBER (R_FR30_GNU_VTENTRY, 12)
-  EMPTY_RELOC  (R_FR30_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_FR30_max)
 
 #endif /* _ELF_FR30_H */
index 0e45d7451fd68d70471e0ba68ff266ba9eb35d5c..af326363f6f2abe22e2348825b2965f7484fa076 100644 (file)
@@ -267,8 +267,7 @@ START_RELOC_NUMBERS (elf_hppa_reloc_type)
     RELOC_NUMBER (R_PARISC_LTOFF_TP16F, 229)
     RELOC_NUMBER (R_PARISC_LTOFF_TP16WF, 230)
     RELOC_NUMBER (R_PARISC_LTOFF_TP16DF, 231)
-    EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_PARISC_UNIMPLEMENTED)
 
 #ifndef RELOC_MACROS_GEN_FUNC
 typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
index 0586661720efa49d52d6a776f93dc6cf14adb76c..a8e1bf43689741008f8378cc7ba90b68bb970fe4 100644 (file)
@@ -40,10 +40,9 @@ START_RELOC_NUMBERS (elf_i386_reloc_type)
      RELOC_NUMBER (R_386_PC16,     21)
      RELOC_NUMBER (R_386_8,       22)
      RELOC_NUMBER (R_386_PC8,      23)
-     RELOC_NUMBER (R_386_max,     24)
      /* These are GNU extensions to enable C++ vtable garbage collection.  */
      RELOC_NUMBER (R_386_GNU_VTINHERIT, 250)
      RELOC_NUMBER (R_386_GNU_VTENTRY, 251)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_386_max)
 
 #endif
index 3e60289ea997197b24c26f896b5899a2a3bcfb8f..2c7a143c68d0637570e487257911ffb5dcaa8413 100644 (file)
@@ -32,7 +32,6 @@ START_RELOC_NUMBERS (elf_i960_reloc_type)
      RELOC_NUMBER (R_960_OPTCALL,   5)
      RELOC_NUMBER (R_960_OPTCALLX,  6)
      RELOC_NUMBER (R_960_OPTCALLXA, 7)
-     EMPTY_RELOC (R_960_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_960_max)
 
 #endif /* _ELF_I960_H */
index 9d50030e512584ab47bf9922eede2f970017d499..15847c80f8477d281cf751348d8e2af5f2f3bf11 100644 (file)
@@ -167,6 +167,6 @@ START_RELOC_NUMBERS (elf_ia64_reloc_type)
   RELOC_NUMBER (R_IA64_LTOFF_TP22, 0x9a) /* @ltoff(sym-TP+add), add imm22 ## */
 
   FAKE_RELOC (R_IA64_MAX_RELOC_CODE, 0x9a)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_IA64_max)
 
 #endif /* _ELF_IA64_H */
index a12ae16aea5bfb3acdd16b818f90889c08b15e67..e4b5dbfc5d792d2e7cca1ea073775e4c8ebf8432 100644 (file)
@@ -37,8 +37,7 @@ START_RELOC_NUMBERS (elf_m32r_reloc_type)
   RELOC_NUMBER (R_M32R_SDA16, 10)
   RELOC_NUMBER (R_M32R_GNU_VTINHERIT, 11)
   RELOC_NUMBER (R_M32R_GNU_VTENTRY, 12)
-  EMPTY_RELOC  (R_M32R_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_M32R_max)
 
 /* Processor specific section indices.  These sections do not actually
    exist.  Symbols with a st_shndx field corresponding to one of these
index e2d51ef4a906815925aa465efb5bd575ab886d16..2c44a58a63fe336a6d62b7f7156d12fe8cf6d944 100644 (file)
@@ -50,8 +50,7 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type)
   /* These are GNU extensions to enable C++ vtable garbage collection.  */
   RELOC_NUMBER (R_68K_GNU_VTINHERIT, 23)
   RELOC_NUMBER (R_68K_GNU_VTENTRY, 24)
-  EMPTY_RELOC  (R_68K_max)   
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_68K_max)
 
 #define EF_CPU32    0x00810000
 
index 62a88c9093ecba655b9e26737982bb78f0fbc387..b96ab60a04b4a577eb0c6c63f03582c8dae8166a 100644 (file)
@@ -38,8 +38,7 @@ START_RELOC_NUMBERS (elf_mcore_reloc_type)
   RELOC_NUMBER (R_MCORE_COPY, 10)
   RELOC_NUMBER (R_MCORE_GLOB_DAT, 11)
   RELOC_NUMBER (R_MCORE_JUMP_SLOT, 12)
-  EMPTY_RELOC  (R_MCORE_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_MCORE_max)
 
 /* Section Attributes.  */
 #define SHF_MCORE_NOREAD       0x80000000
index e5e37393d9bb4810be9273691a1e628ca51f25b1..f7f03d94f123c2aba5ea95cdf33800eba565445b 100644 (file)
@@ -84,7 +84,7 @@ START_RELOC_NUMBERS (elf_mips_reloc_type)
   /* These are GNU extensions to enable C++ vtable garbage collection.  */
   RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253)
   RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_MIPS_maxext)
 
 /* Processor specific flags for the ELF header e_flags field.  */
 
index 5e29e0ad21193780a244521fc66b2b53d48e1c2d..d7c102e00c15a669236d699c9bf60a35d52659e8 100644 (file)
@@ -34,6 +34,6 @@ START_RELOC_NUMBERS (elf_mn10200_reloc_type)
   RELOC_NUMBER (R_MN10200_PCREL8, 5)
   RELOC_NUMBER (R_MN10200_PCREL16, 6)
   RELOC_NUMBER (R_MN10200_PCREL24, 7)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_MN10200_max)
 
 #endif /* _ELF_MN10200_H */
index 4e7fce5c8662c653f9f997e94ae14e6f30c52244..29fea0f694167c9000ba984b113f9b8079202fee 100644 (file)
@@ -36,8 +36,7 @@ START_RELOC_NUMBERS (elf_mn10300_reloc_type)
   RELOC_NUMBER (R_MN10300_GNU_VTINHERIT, 7)
   RELOC_NUMBER (R_MN10300_GNU_VTENTRY, 8)
   RELOC_NUMBER (R_MN10300_24, 9)
-  EMPTY_RELOC  (R_MN10300_MAX)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_MN10300_MAX)
 
 /* Machine variant if we know it.  This field was invented at Cygnus,
    but it is hoped that other vendors will adopt it.  If some standard
index 6bb8306523e7b81d2f43422684b7904a9f4a70f2..07d4583b07f5556ef61f9a055e93c4c2af0bf1c1 100644 (file)
@@ -35,8 +35,7 @@ START_RELOC_NUMBERS (elf_pj_reloc_type)
   RELOC_NUMBER (R_PJ_CODE_HI16, 14)
   RELOC_NUMBER (R_PJ_GNU_VTINHERIT, 15)
   RELOC_NUMBER (R_PJ_GNU_VTENTRY, 16)
-  EMPTY_RELOC (R_PJ_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_PJ_max)
 
 #define EF_PICOJAVA_ARCH     0x0000000f
 #define EF_PICOJAVA_NEWCALLS 0x00000010
index b3116d8ad01f93d7df9a4c08203671672aa73f80..b37be7c33c6f88ef5bfa843644da460e43c86495 100644 (file)
@@ -96,8 +96,7 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type)
    that may still be in object files.  */
   RELOC_NUMBER (R_PPC_TOC16, 255)
 
-  EMPTY_RELOC (R_PPC_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_PPC_max)
 
 
 /* Processor specific flags for the ELF header e_flags field.  */
index 9c27e8930d643ee7b2f2e94e21997f830a403222..d00614746c5a095144cf6f408e833134245f4979 100644 (file)
        START_RELOC_NUMBERS (foo)
            RELOC_NUMBER (R_foo_NONE,    0)
            RELOC_NUMBER (R_foo_32,      1)
-           FAKE_RELOC   (R_foo_illegal, 2)
-           EMPTY_RELOC  (R_foo_max)
-       END_RELOC_NUMBERS
+           EMPTY_RELOC  (R_foo_good)
+           FAKE_RELOC   (R_foo_illegal, 9)
+       END_RELOC_NUMBERS (R_foo_count)
 
    Then the following will be produced by default (ie if
    RELOC_MACROS_GEN_FUNC is *not* defined).
 
        enum foo
        {
-         foo = -1,
          R_foo_NONE = 0,
          R_foo_32 = 1,
-         R_foo_illegal = 2,
-         R_foo_max
+         R_foo_good,
+         R_foo_illegal = 9,
+         R_foo_count
        };
 
    If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
@@ -87,7 +87,7 @@ name (rtype)                                                  \
 #define FAKE_RELOC(name, number)
 #define EMPTY_RELOC(name)
 
-#define END_RELOC_NUMBERS      \
+#define END_RELOC_NUMBERS(name)        \
     default: return NULL;      \
   }                            \
 }
@@ -95,21 +95,11 @@ name (rtype)                                                        \
 
 #else /* Default to generating enum.  */
 
-/* Some compilers cannot cope with an enum that ends with a trailing
-   comma, so START_RELOC_NUMBERS creates a fake reloc entry, (initialised
-   to -1 so that the first real entry will still default to 0).  Further
-   entries then prepend a comma to their definitions, creating a list
-   of enumerator entries that will satisfy these compilers.  */
-#if defined (__STDC__) || defined (ALMOST_STDC)
-#define START_RELOC_NUMBERS(name)   enum name { _##name = -1
-#else
-#define START_RELOC_NUMBERS(name)   enum name { _/**/name = -1
-#endif
-
-#define RELOC_NUMBER(name, number)  , name = number
-#define FAKE_RELOC(name, number)    , name = number
-#define EMPTY_RELOC(name)           , name
-#define END_RELOC_NUMBERS           };
+#define START_RELOC_NUMBERS(name)   enum name {
+#define RELOC_NUMBER(name, number)  name = number,
+#define FAKE_RELOC(name, number)    name = number,
+#define EMPTY_RELOC(name)           name,
+#define END_RELOC_NUMBERS(name)     name };
 
 #endif
 
index 2b132c1cb3b8a68e5780f007a7220ef51f828b9b..ae096984c574276ee91a4e53958f5c5cf246b899 100644 (file)
@@ -78,7 +78,6 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
   RELOC_NUMBER (R_SH_GNU_VTENTRY, 35)
   RELOC_NUMBER (R_SH_LOOP_START, 36)
   RELOC_NUMBER (R_SH_LOOP_END, 37)
-  EMPTY_RELOC (R_SH_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_SH_max)
 
 #endif
index 390e4a844966c2bcd7d0b89df45730991d3be387..7b2380f7c947995f1dc9bbbcfd52fb969f62df58 100644 (file)
@@ -134,8 +134,7 @@ START_RELOC_NUMBERS (elf_sparc_reloc_type)
   RELOC_NUMBER (R_SPARC_GNU_VTINHERIT, 250)
   RELOC_NUMBER (R_SPARC_GNU_VTENTRY, 251)
 
-  EMPTY_RELOC  (R_SPARC_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_SPARC_max)
 
 /* Relocation macros.  */
 
index d443b7fdc0d90fec0ceaa25c99d87167c7563753..45b0e39bc948102fb7adab73729f7f65728bdb14 100644 (file)
@@ -77,9 +77,7 @@ START_RELOC_NUMBERS (v850_reloc_type)
 /* END CYGNUS LOCAL */
      RELOC_NUMBER (R_V850_GNU_VTINHERIT, 23)
      RELOC_NUMBER (R_V850_GNU_VTENTRY, 24)
-
-     EMPTY_RELOC (R_V850_max)
-END_RELOC_NUMBERS
+END_RELOC_NUMBERS (R_V850_max)
 
 \f
 /* Processor specific section indices.  These sections do not actually
This page took 0.042573 seconds and 4 git commands to generate.