diff options
| author | James Morris <james.l.morris@oracle.com> | 2014-01-06 22:23:01 +1100 |
|---|---|---|
| committer | James Morris <james.l.morris@oracle.com> | 2014-01-06 22:23:01 +1100 |
| commit | 38fd2c202a3d82bc12430bce5789fa2c2a406f71 (patch) | |
| tree | a73513dbb015155f5236b391709b9083916b3136 /scripts/sortextable.c | |
| parent | dcf4e392867bf98d50ad108ed7c2bfb941e8c33d (diff) | |
| parent | d6e0a2dd12f4067a5bcefb8bbd8ddbeff800afbc (diff) | |
Merge to v3.13-rc7 for prerequisite changes in the Xen code for TPM
Diffstat (limited to 'scripts/sortextable.c')
| -rw-r--r-- | scripts/sortextable.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/sortextable.c b/scripts/sortextable.c index 7c2310c5b996..7941fbdfb050 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c @@ -31,6 +31,10 @@ #include <tools/be_byteshift.h> #include <tools/le_byteshift.h> +#ifndef EM_ARCOMPACT +#define EM_ARCOMPACT 93 +#endif + #ifndef EM_AARCH64 #define EM_AARCH64 183 #endif @@ -152,6 +156,30 @@ static void (*w2)(uint16_t, uint16_t *); typedef void (*table_sort_t)(char *, int); +/* + * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of + * the way to -256..-1, to avoid conflicting with real section + * indices. + */ +#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1)) + +static inline int is_shndx_special(unsigned int i) +{ + return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE; +} + +/* Accessor for sym->st_shndx, hides ugliness of "64k sections" */ +static inline unsigned int get_secindex(unsigned int shndx, + unsigned int sym_offs, + const Elf32_Word *symtab_shndx_start) +{ + if (is_shndx_special(shndx)) + return SPECIAL(shndx); + if (shndx != SHN_XINDEX) + return shndx; + return r(&symtab_shndx_start[sym_offs]); +} + /* 32 bit and 64 bit are very similar */ #include "sortextable.h" #define SORTEXTABLE_64 @@ -244,6 +272,7 @@ do_file(char const *const fname) case EM_S390: custom_sort = sort_relative_table; break; + case EM_ARCOMPACT: case EM_ARM: case EM_AARCH64: case EM_MIPS: |
