diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-07-22 22:01:56 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-07-22 22:01:56 +0000 |
commit | 86b9b00b99d5ac8ed4de39ad7ea6a7a7694051f3 (patch) | |
tree | 92ba44bef3990fdb36d709254981b3e948e04069 /include/elf/sh.h | |
parent | 133a451e9f1c3096fb7269cb063a88ce4067850f (diff) | |
download | fsf-binutils-gdb-86b9b00b99d5ac8ed4de39ad7ea6a7a7694051f3.zip fsf-binutils-gdb-86b9b00b99d5ac8ed4de39ad7ea6a7a7694051f3.tar.gz fsf-binutils-gdb-86b9b00b99d5ac8ed4de39ad7ea6a7a7694051f3.tar.bz2 |
Rewrite relocation definition using macros.
Diffstat (limited to 'include/elf/sh.h')
-rw-r--r-- | include/elf/sh.h | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/include/elf/sh.h b/include/elf/sh.h index eab7c45..e853479 100644 --- a/include/elf/sh.h +++ b/include/elf/sh.h @@ -20,23 +20,33 @@ #ifndef _ELF_SH_H #define _ELF_SH_H -#define R_SH_NONE 0 -#define R_SH_DIR32 1 -#define R_SH_REL32 2 -#define R_SH_DIR8WPN 3 -#define R_SH_IND12W 4 -#define R_SH_DIR8WPL 5 -#define R_SH_DIR8WPZ 6 -#define R_SH_DIR8BP 7 -#define R_SH_DIR8W 8 -#define R_SH_DIR8L 9 -#define R_SH_SWITCH16 25 -#define R_SH_SWITCH32 26 -#define R_SH_USES 27 -#define R_SH_COUNT 28 -#define R_SH_ALIGN 29 -#define R_SH_CODE 30 -#define R_SH_DATA 31 -#define R_SH_LABEL 32 +/* Unless otherwise told we define an enum with the relocation entries. */ +#ifndef START_RELOC_NUMBERS +# define START_RELOC_NUMBERS(name) enum name { +# define RELOC_NUMBER(name, number) name = number , +# define END_RELOC_NUMBERS }; +#endif + +/* Relocations. */ +START_RELOC_NUMBERS (elf_sh_reloc_type) + RELOC_NUMBER (R_SH_NONE, 0) + RELOC_NUMBER (R_SH_DIR32, 1) + RELOC_NUMBER (R_SH_REL32, 2) + RELOC_NUMBER (R_SH_DIR8WPN, 3) + RELOC_NUMBER (R_SH_IND12W, 4) + RELOC_NUMBER (R_SH_DIR8WPL, 5) + RELOC_NUMBER (R_SH_DIR8WPZ, 6) + RELOC_NUMBER (R_SH_DIR8BP, 7) + RELOC_NUMBER (R_SH_DIR8W, 8) + RELOC_NUMBER (R_SH_DIR8L, 9) + RELOC_NUMBER (R_SH_SWITCH16, 25) + RELOC_NUMBER (R_SH_SWITCH32, 26) + RELOC_NUMBER (R_SH_USES, 27) + RELOC_NUMBER (R_SH_COUNT, 28) + RELOC_NUMBER (R_SH_ALIGN, 29) + RELOC_NUMBER (R_SH_CODE, 30) + RELOC_NUMBER (R_SH_DATA, 31) + RELOC_NUMBER (R_SH_LABEL, 32) +END_RELOC_NUMBERS #endif |