Skip to content

Commit

Permalink
Ifdef out handling for relocs which never occur during bootstrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Nov 23, 2000
1 parent ba4cf0e commit 33e0916
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions sysdeps/sparc/sparc32/dl-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,

switch (ELF32_R_TYPE (reloc->r_info))
{
#ifndef RTLD_BOOTSTRAP
case R_SPARC_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be
Expand All @@ -397,13 +398,15 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;
#endif
case R_SPARC_GLOB_DAT:
case R_SPARC_32:
*reloc_addr = value;
break;
case R_SPARC_JMP_SLOT:
elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value);
break;
#ifndef RTLD_BOOTSTRAP
case R_SPARC_8:
*(char *) reloc_addr = value;
break;
Expand All @@ -429,11 +432,14 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_SPARC_HI22:
*reloc_addr = (*reloc_addr & 0xffc00000) | (value >> 10);
break;
#endif
case R_SPARC_NONE: /* Alright, Wilbur. */
break;
#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
default:
_dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
break;
#endif
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions sysdeps/sparc/sparc64/dl-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,

switch (ELF64_R_TYPE_ID (reloc->r_info))
{
#ifndef RTLD_BOOTSTRAP
case R_SPARC_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be
Expand All @@ -232,11 +233,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;

#endif
case R_SPARC_64:
case R_SPARC_GLOB_DAT:
*reloc_addr = value;
break;
#ifndef RTLD_BOOTSTRAP
case R_SPARC_8:
*(char *) reloc_addr = value;
break;
Expand Down Expand Up @@ -311,11 +313,11 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
((*(unsigned int *)reloc_addr & 0xffc00000) |
((value >> 10) & 0x003fffff));
break;

#endif
case R_SPARC_JMP_SLOT:
elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value);
break;

#ifndef RTLD_BOOTSTRAP
case R_SPARC_UA64:
if (! ((long) reloc_addr & 3))
{
Expand All @@ -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) [7] = value;
break;

#endif
#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
default:
_dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
break;
#endif
}
}
}
Expand Down

0 comments on commit 33e0916

Please sign in to comment.