aboutsummaryrefslogtreecommitdiff
path: root/include/elf/reloc-macros.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-06-07 03:43:33 +0000
committerAlan Modra <amodra@gmail.com>2000-06-07 03:43:33 +0000
commit1b452ec66bd22e10bfa182d8e6995f0037486560 (patch)
tree0de40f36aea82f8394c6fff3aab17271dcae57fa /include/elf/reloc-macros.h
parent3e0bf9f1f0e77a5d40d6799fa49795350c39333e (diff)
downloadgdb-1b452ec66bd22e10bfa182d8e6995f0037486560.zip
gdb-1b452ec66bd22e10bfa182d8e6995f0037486560.tar.gz
gdb-1b452ec66bd22e10bfa182d8e6995f0037486560.tar.bz2
Get rid of the -1 dummy valued enum in START_RELOC_NUMBERS.
Remove duplicate reloc enums in elf32-d[13]0v.c Remove EMPTY_HOWTOs in elf32-i386.c
Diffstat (limited to 'include/elf/reloc-macros.h')
-rw-r--r--include/elf/reloc-macros.h34
1 files changed, 12 insertions, 22 deletions
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index 9c27e89..d006147 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -27,20 +27,20 @@
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