diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-12-10 01:22:40 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-12-10 01:22:40 -0500 |
| commit | 5d43889c07bb38694742936aa70d1187c012e198 (patch) | |
| tree | 73809dddae39ae3b746396e9779142dbd1973f33 /scripts/sortextable.c | |
| parent | 95f75e91588afecfb0090988393653d21f5d1f91 (diff) | |
| parent | 374b105797c3d4f29c685f3be535c35f5689b30e (diff) | |
Merge tag 'v3.13-rc3' into for-linus
Merging with the mainline to sync up on changes to serio core.
Diffstat (limited to 'scripts/sortextable.c')
| -rw-r--r-- | scripts/sortextable.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/sortextable.c b/scripts/sortextable.c index 7c2310c5b996..5f7a8b663cb9 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c | |||
| @@ -152,6 +152,30 @@ static void (*w2)(uint16_t, uint16_t *); | |||
| 152 | 152 | ||
| 153 | typedef void (*table_sort_t)(char *, int); | 153 | typedef void (*table_sort_t)(char *, int); |
| 154 | 154 | ||
| 155 | /* | ||
| 156 | * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of | ||
| 157 | * the way to -256..-1, to avoid conflicting with real section | ||
| 158 | * indices. | ||
| 159 | */ | ||
| 160 | #define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1)) | ||
| 161 | |||
| 162 | static inline int is_shndx_special(unsigned int i) | ||
| 163 | { | ||
| 164 | return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE; | ||
| 165 | } | ||
| 166 | |||
| 167 | /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */ | ||
| 168 | static inline unsigned int get_secindex(unsigned int shndx, | ||
| 169 | unsigned int sym_offs, | ||
| 170 | const Elf32_Word *symtab_shndx_start) | ||
| 171 | { | ||
| 172 | if (is_shndx_special(shndx)) | ||
| 173 | return SPECIAL(shndx); | ||
| 174 | if (shndx != SHN_XINDEX) | ||
| 175 | return shndx; | ||
| 176 | return r(&symtab_shndx_start[sym_offs]); | ||
| 177 | } | ||
| 178 | |||
| 155 | /* 32 bit and 64 bit are very similar */ | 179 | /* 32 bit and 64 bit are very similar */ |
| 156 | #include "sortextable.h" | 180 | #include "sortextable.h" |
| 157 | #define SORTEXTABLE_64 | 181 | #define SORTEXTABLE_64 |
