diff options
| author | Alan Modra | 2015-11-08 09:29:00 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-11-08 10:01:00 -0800 |
| commit | 8285c2ab8050de218c0c06182659ee0a7b23a0f6 (patch) | |
| tree | 733a44ef4fa4a322586ae28e085de55db600d928 /src | |
| parent | 3ff9fc0e8d738be5004c65c3be314af9aca68148 (diff) | |
| download | emacs-8285c2ab8050de218c0c06182659ee0a7b23a0f6.tar.gz emacs-8285c2ab8050de218c0c06182659ee0a7b23a0f6.zip | |
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')
| -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: | |||
| 1202 | } | 1202 | } |
| 1203 | 1203 | ||
| 1204 | /* This loop seeks out relocation sections for the data section, so | 1204 | /* This loop seeks out relocation sections for the data section, so |
| 1205 | that it can undo relocations performed by the runtime linker. */ | 1205 | that it can undo relocations performed by the runtime loader. */ |
| 1206 | for (n = new_file_h->e_shnum; 0 < --n; ) | 1206 | for (n = new_file_h->e_shnum; 0 < --n; ) |
| 1207 | { | 1207 | { |
| 1208 | ElfW (Shdr) *rel_shdr = &NEW_SECTION_H (n); | 1208 | ElfW (Shdr) *rel_shdr = &NEW_SECTION_H (n); |
| @@ -1235,14 +1235,14 @@ temacs: | |||
| 1235 | reloc += rel_shdr->sh_entsize) | 1235 | reloc += rel_shdr->sh_entsize) |
| 1236 | { | 1236 | { |
| 1237 | ElfW (Addr) addr = ((ElfW (Rel) *) reloc)->r_offset - offset; | 1237 | ElfW (Addr) addr = ((ElfW (Rel) *) reloc)->r_offset - offset; |
| 1238 | #ifdef __alpha__ | 1238 | /* Ignore R_*_NONE relocs. */ |
| 1239 | /* The Alpha ELF binutils currently have a bug that | ||
| 1240 | sometimes results in relocs that contain all | ||
| 1241 | zeroes. Work around this for now... */ | ||
| 1242 | if (((ElfW (Rel) *) reloc)->r_offset == 0) | 1239 | if (((ElfW (Rel) *) reloc)->r_offset == 0) |
| 1243 | continue; | 1240 | continue; |
| 1244 | #endif | 1241 | /* Assume reloc applies to a word. |
| 1245 | memcpy (new_base + addr, old_base + addr, sizeof (ElfW (Addr))); | 1242 | ??? This is not always true, eg. TLS module/index |
| 1243 | pair in .got which occupies two words. */ | ||
| 1244 | memcpy (new_base + addr, old_base + addr, | ||
| 1245 | sizeof (ElfW (Addr))); | ||
| 1246 | } | 1246 | } |
| 1247 | } | 1247 | } |
| 1248 | break; | 1248 | break; |