aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-01-16 20:31:03 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-01-16 20:31:03 -0800
commit22676eafedd0df276d85ea7c7ef63907d689d6ad (patch)
tree58b907fa84d7432549332de8615907b2de76a665 /sysdeps
parent59981e9b0df84aa91c52d21c54a7ed158a356aaa (diff)
downloadglibc-22676eafedd0df276d85ea7c7ef63907d689d6ad.tar
glibc-22676eafedd0df276d85ea7c7ef63907d689d6ad.tar.gz
glibc-22676eafedd0df276d85ea7c7ef63907d689d6ad.tar.bz2
glibc-22676eafedd0df276d85ea7c7ef63907d689d6ad.zip
Implement x86 SIZE32/SIZE64 relocations
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/dl-machine.h9
-rw-r--r--sysdeps/x86_64/dl-machine.h20
2 files changed, 29 insertions, 0 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 9e36687eff..a1e40d8eb0 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -348,6 +348,12 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
switch (r_type)
{
+# ifndef RTLD_BOOTSTRAP
+ case R_386_SIZE32:
+ /* Set to symbol size plus addend. */
+ *reloc_addr += sym->st_size;
+ break;
+# endif
case R_386_GLOB_DAT:
case R_386_JMP_SLOT:
*reloc_addr = value;
@@ -507,6 +513,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
switch (ELF32_R_TYPE (reloc->r_info))
{
+ case R_386_SIZE32:
+ /* Set to symbol size plus addend. */
+ value = sym->st_size;
case R_386_GLOB_DAT:
case R_386_JMP_SLOT:
case R_386_32:
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 660f1aa1e2..4768c69544 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -286,6 +286,21 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
switch (r_type)
{
+# ifndef RTLD_BOOTSTRAP
+# ifdef __ILP32__
+ case R_X86_64_SIZE64:
+ /* Set to symbol size plus addend. */
+ *(Elf64_Addr *) (uintptr_t) reloc_addr
+ = (Elf64_Addr) sym->st_size + reloc->r_addend;
+ break;
+
+ case R_X86_64_SIZE32:
+# else
+ case R_X86_64_SIZE64:
+# endif
+ /* Set to symbol size plus addend. */
+ value = sym->st_size;
+# endif
case R_X86_64_GLOB_DAT:
case R_X86_64_JUMP_SLOT:
*reloc_addr = value + reloc->r_addend;
@@ -394,6 +409,11 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
relocation updates the whole 64-bit entry. */
*(Elf64_Addr *) reloc_addr = (Elf64_Addr) value + reloc->r_addend;
break;
+# ifndef __ILP32__
+ case R_X86_64_SIZE32:
+ /* Set to symbol size plus addend. */
+ value = sym->st_size;
+# endif
case R_X86_64_32:
value += reloc->r_addend;
*(unsigned int *) reloc_addr = value;