Ifdef out handling for relocs which never occur during bootstrap.

This commit is contained in:
Ulrich Drepper 2000-11-23 17:26:27 +00:00
parent ba4cf0e9ef
commit 33e09162d0
2 changed files with 14 additions and 4 deletions

View File

@ -377,6 +377,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
switch (ELF32_R_TYPE (reloc->r_info)) switch (ELF32_R_TYPE (reloc->r_info))
{ {
#ifndef RTLD_BOOTSTRAP
case R_SPARC_COPY: case R_SPARC_COPY:
if (sym == NULL) if (sym == NULL)
/* This can happen in trace mode if an object could not be /* This can happen in trace mode if an object could not be
@ -397,6 +398,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));
break; break;
#endif
case R_SPARC_GLOB_DAT: case R_SPARC_GLOB_DAT:
case R_SPARC_32: case R_SPARC_32:
*reloc_addr = value; *reloc_addr = value;
@ -404,6 +406,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_SPARC_JMP_SLOT: case R_SPARC_JMP_SLOT:
elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value); elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value);
break; break;
#ifndef RTLD_BOOTSTRAP
case R_SPARC_8: case R_SPARC_8:
*(char *) reloc_addr = value; *(char *) reloc_addr = value;
break; break;
@ -429,11 +432,14 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_SPARC_HI22: case R_SPARC_HI22:
*reloc_addr = (*reloc_addr & 0xffc00000) | (value >> 10); *reloc_addr = (*reloc_addr & 0xffc00000) | (value >> 10);
break; break;
#endif
case R_SPARC_NONE: /* Alright, Wilbur. */ case R_SPARC_NONE: /* Alright, Wilbur. */
break; break;
#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
default: default:
_dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0); _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
break; break;
#endif
} }
} }
} }

View File

@ -212,6 +212,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
switch (ELF64_R_TYPE_ID (reloc->r_info)) switch (ELF64_R_TYPE_ID (reloc->r_info))
{ {
#ifndef RTLD_BOOTSTRAP
case R_SPARC_COPY: case R_SPARC_COPY:
if (sym == NULL) if (sym == NULL)
/* This can happen in trace mode if an object could not be /* This can happen in trace mode if an object could not be
@ -232,11 +233,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));
break; break;
#endif
case R_SPARC_64: case R_SPARC_64:
case R_SPARC_GLOB_DAT: case R_SPARC_GLOB_DAT:
*reloc_addr = value; *reloc_addr = value;
break; break;
#ifndef RTLD_BOOTSTRAP
case R_SPARC_8: case R_SPARC_8:
*(char *) reloc_addr = value; *(char *) reloc_addr = value;
break; break;
@ -311,11 +313,11 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
((*(unsigned int *)reloc_addr & 0xffc00000) | ((*(unsigned int *)reloc_addr & 0xffc00000) |
((value >> 10) & 0x003fffff)); ((value >> 10) & 0x003fffff));
break; break;
#endif
case R_SPARC_JMP_SLOT: case R_SPARC_JMP_SLOT:
elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value); elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value);
break; break;
#ifndef RTLD_BOOTSTRAP
case R_SPARC_UA64: case R_SPARC_UA64:
if (! ((long) reloc_addr & 3)) if (! ((long) reloc_addr & 3))
{ {
@ -333,10 +335,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
((unsigned char *) reloc_addr) [6] = value >> 8; ((unsigned char *) reloc_addr) [6] = value >> 8;
((unsigned char *) reloc_addr) [7] = value; ((unsigned char *) reloc_addr) [7] = value;
break; break;
#endif
#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
default: default:
_dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0); _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
break; break;
#endif
} }
} }
} }