diff options
| -rw-r--r-- | src/unexelf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index 0065491b453..286ba2e99c1 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -1118,7 +1118,7 @@ temacs: | |||
| 1118 | } | 1118 | } |
| 1119 | #endif /* __sgi */ | 1119 | #endif /* __sgi */ |
| 1120 | 1120 | ||
| 1121 | /* If it is the symbol table, its st_shndx field needs to be patched. */ | 1121 | /* Patch st_shndx field of symbol table. */ |
| 1122 | if (new_shdr->sh_type == SHT_SYMTAB | 1122 | if (new_shdr->sh_type == SHT_SYMTAB |
| 1123 | || new_shdr->sh_type == SHT_DYNSYM) | 1123 | || new_shdr->sh_type == SHT_DYNSYM) |
| 1124 | { | 1124 | { |
| @@ -1126,9 +1126,10 @@ temacs: | |||
| 1126 | ElfW (Sym) *sym = (ElfW (Sym) *) (new_shdr->sh_offset + new_base); | 1126 | ElfW (Sym) *sym = (ElfW (Sym) *) (new_shdr->sh_offset + new_base); |
| 1127 | for (; num--; sym++) | 1127 | for (; num--; sym++) |
| 1128 | { | 1128 | { |
| 1129 | if ((sym->st_shndx == SHN_UNDEF) | 1129 | if (sym->st_shndx == SHN_XINDEX) |
| 1130 | || (sym->st_shndx == SHN_ABS) | 1130 | fatal ("SHT_SYMTAB_SHNDX unsupported"); |
| 1131 | || (sym->st_shndx == SHN_COMMON)) | 1131 | if (sym->st_shndx == SHN_UNDEF |
| 1132 | || sym->st_shndx >= SHN_LORESERVE) | ||
| 1132 | continue; | 1133 | continue; |
| 1133 | 1134 | ||
| 1134 | PATCH_INDEX (sym->st_shndx); | 1135 | PATCH_INDEX (sym->st_shndx); |