about summary refs log tree commit diff
path: root/sysdeps/sh/dl-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sh/dl-machine.h')
-rw-r--r--sysdeps/sh/dl-machine.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h
index dd21dfbb9c..99109f7a83 100644
--- a/sysdeps/sh/dl-machine.h
+++ b/sysdeps/sh/dl-machine.h
@@ -433,7 +433,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 #ifndef RTLD_BOOTSTRAP
       if (map != &_dl_rtld_map) /* Already done in rtld itself.	 */
 #endif
-	*reloc_addr = map->l_addr + reloc->r_addend;
+	{
+	  if (reloc->r_addend)
+	    *reloc_addr = map->l_addr + reloc->r_addend;
+	  else
+	    *reloc_addr += map->l_addr;
+	}
     }
   else if (ELF32_R_TYPE (reloc->r_info) != R_SH_NONE)
     {