[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 190b968 4/9: ELF unexec: Symbol table patching
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 190b968 4/9: ELF unexec: Symbol table patching |
Date: |
Sun, 08 Nov 2015 18:01:09 +0000 |
branch: master
commit 190b968f189cb7d06223bb39045ec9055df67f68
Author: Alan Modra <address@hidden>
Commit: Paul Eggert <address@hidden>
ELF unexec: Symbol table patching
No st_shndx value larger than SHN_LORESERVE should be changed.
* unexelf.c (unexec): Don't adjust any st_shndx larger than
SHN_LORESERVE. Error on SHN_XINDEX.
---
src/unexelf.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/unexelf.c b/src/unexelf.c
index 0065491..286ba2e 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1118,7 +1118,7 @@ temacs:
}
#endif /* __sgi */
- /* If it is the symbol table, its st_shndx field needs to be patched. */
+ /* Patch st_shndx field of symbol table. */
if (new_shdr->sh_type == SHT_SYMTAB
|| new_shdr->sh_type == SHT_DYNSYM)
{
@@ -1126,9 +1126,10 @@ temacs:
ElfW (Sym) *sym = (ElfW (Sym) *) (new_shdr->sh_offset + new_base);
for (; num--; sym++)
{
- if ((sym->st_shndx == SHN_UNDEF)
- || (sym->st_shndx == SHN_ABS)
- || (sym->st_shndx == SHN_COMMON))
+ if (sym->st_shndx == SHN_XINDEX)
+ fatal ("SHT_SYMTAB_SHNDX unsupported");
+ if (sym->st_shndx == SHN_UNDEF
+ || sym->st_shndx >= SHN_LORESERVE)
continue;
PATCH_INDEX (sym->st_shndx);
- [Emacs-diffs] master updated (82c1b36 -> 2ce0c06), Paul Eggert, 2015/11/08
- [Emacs-diffs] master 0bcd08e 1/9: ELF unexec: Correct section header index, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 190b968 4/9: ELF unexec: Symbol table patching,
Paul Eggert <=
- [Emacs-diffs] master 47c6e30 3/9: ELF unexec: Merge Alpha and MIPS COFF debug handling, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 3ff9fc0 5/9: ELF unexec: _OBJC_ symbols in bss sections, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 856f4ea 2/9: ELF unexec: Tidy code, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 2ce0c06 9/9: * src/unexelf.c (NEW_PROGRAM_H): Remove unused macro (Bug#20614)., Paul Eggert, 2015/11/08
- [Emacs-diffs] master 8285c2a 6/9: ELF unexec: R_*_NONE relocs, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 3008c52 8/9: ELF unexec: Don't insert a new section, Paul Eggert, 2015/11/08
- [Emacs-diffs] master 0d64422 7/9: ELF unexec: Drive from PT_LOAD header rather than sections, Paul Eggert, 2015/11/08