summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-05-19 16:52:56 +0200
committerMark Wielaard <mjw@redhat.com>2014-05-19 22:04:24 +0200
commit028d0ab0cc1cb5f96ee48feef966b7d8d56c6a8e (patch)
treea8217d678cede635782d0fe33413a3dc3ae206af /backends
parent85482fc073442a056e0e3663eb454fa76d883271 (diff)
downloadelfutils-028d0ab0cc1cb5f96ee48feef966b7d8d56c6a8e.tar.gz
backends: Add ebl_check_reloc_target_type.
And implement for arm and ia64. Both have special section types that are valid targets for a reloc. Both refer to unwind data. elflint now just calls ebl_check_reloc_target_type instead of hard coding the expected section types. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/ChangeLog7
-rw-r--r--backends/arm_init.c1
-rw-r--r--backends/arm_symbol.c9
-rw-r--r--backends/ia64_init.c3
-rw-r--r--backends/ia64_symbol.c9
5 files changed, 26 insertions, 3 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 748d0a06..bc5b8434 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,10 @@
+2014-05-19 Mark Wielaard <mjw@redhat.com>
+
+ * arm_init.c (arm_init): Hook check_reloc_target_type.
+ * arm_symbol.c (arm_check_reloc_target_type): New function.
+ * ia64_init.c (ia64_init): Hook check_reloc_target_type.
+ * ia64_symbol.c (ia64_check_reloc_target_type): New function.
+
2014-04-22 Kurt Roeckx <kurt@roeckx.be>
* i386_initreg.c: Make Linux only.
diff --git a/backends/arm_init.c b/backends/arm_init.c
index 14b26356..92e6cd51 100644
--- a/backends/arm_init.c
+++ b/backends/arm_init.c
@@ -63,6 +63,7 @@ arm_init (elf, machine, eh, ehlen)
HOOK (eh, check_object_attribute);
HOOK (eh, return_value_location);
HOOK (eh, abi_cfi);
+ HOOK (eh, check_reloc_target_type);
/* We only unwind the core integer registers. */
eh->frame_nregs = 16;
diff --git a/backends/arm_symbol.c b/backends/arm_symbol.c
index e41ce347..cd467ffc 100644
--- a/backends/arm_symbol.c
+++ b/backends/arm_symbol.c
@@ -1,5 +1,5 @@
/* Arm specific symbolic name handling.
- Copyright (C) 2002-2009 Red Hat, Inc.
+ Copyright (C) 2002-2009, 2014 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -122,3 +122,10 @@ arm_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
return ELF_T_NUM;
}
}
+
+/* The SHT_ARM_EXIDX section type is a valid target for relocation. */
+bool
+arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
+{
+ return sh_type == SHT_ARM_EXIDX;
+}
diff --git a/backends/ia64_init.c b/backends/ia64_init.c
index ed56efaa..91da748d 100644
--- a/backends/ia64_init.c
+++ b/backends/ia64_init.c
@@ -1,5 +1,5 @@
/* Initialization of IA-64 specific backend library.
- Copyright (C) 2002, 2003, 2005, 2006, 2007 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2005, 2006, 2007, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -61,6 +61,7 @@ ia64_init (elf, machine, eh, ehlen)
HOOK (eh, machine_section_flag_check);
HOOK (eh, register_info);
HOOK (eh, return_value_location);
+ HOOK (eh, check_reloc_target_type);
return MODVERSION;
}
diff --git a/backends/ia64_symbol.c b/backends/ia64_symbol.c
index 8d806b02..f928b0b7 100644
--- a/backends/ia64_symbol.c
+++ b/backends/ia64_symbol.c
@@ -1,5 +1,5 @@
/* IA-64 specific symbolic name handling.
- Copyright (C) 2002-2009 Red Hat, Inc.
+ Copyright (C) 2002-2009, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -148,3 +148,10 @@ ia64_reloc_simple_type (Ebl *ebl, int type)
return ELF_T_NUM;
}
+
+/* The SHT_IA_64_UNWIND section type is a valid target for relocation. */
+bool
+ia64_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
+{
+ return sh_type == SHT_IA_64_UNWIND;
+}