diff options
author | Alan Modra <amodra@gmail.com> | 2015-11-08 09:29:00 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-08 10:01:00 -0800 |
commit | 8285c2ab8050de218c0c06182659ee0a7b23a0f6 (patch) | |
tree | 733a44ef4fa4a322586ae28e085de55db600d928 /src/unexelf.c | |
parent | 3ff9fc0e8d738be5004c65c3be314af9aca68148 (diff) | |
download | emacs-8285c2ab8050de218c0c06182659ee0a7b23a0f6.tar.gz |
ELF unexec: R_*_NONE relocs
These should be ignored on all targets.
* unexelf.c (unexec): Ignore R_*_NONE relocs for any target,
not just Alpha. Comment on reloc size assumption.
Diffstat (limited to 'src/unexelf.c')
-rw-r--r-- | src/unexelf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index df99f92a466..15a4cdedfc9 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -1202,7 +1202,7 @@ temacs: } /* This loop seeks out relocation sections for the data section, so - that it can undo relocations performed by the runtime linker. */ + that it can undo relocations performed by the runtime loader. */ for (n = new_file_h->e_shnum; 0 < --n; ) { ElfW (Shdr) *rel_shdr = &NEW_SECTION_H (n); @@ -1235,14 +1235,14 @@ temacs: reloc += rel_shdr->sh_entsize) { ElfW (Addr) addr = ((ElfW (Rel) *) reloc)->r_offset - offset; -#ifdef __alpha__ - /* The Alpha ELF binutils currently have a bug that - sometimes results in relocs that contain all - zeroes. Work around this for now... */ + /* Ignore R_*_NONE relocs. */ if (((ElfW (Rel) *) reloc)->r_offset == 0) continue; -#endif - memcpy (new_base + addr, old_base + addr, sizeof (ElfW (Addr))); + /* Assume reloc applies to a word. + ??? This is not always true, eg. TLS module/index + pair in .got which occupies two words. */ + memcpy (new_base + addr, old_base + addr, + sizeof (ElfW (Addr))); } } break; |