aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2004-01-26 20:32:08 +0000
committerH.J. Lu <hjl.tools@gmail.com>2004-01-26 20:32:08 +0000
commit838e70c548d07aa651332912e3d537ea0772c98e (patch)
tree035c77c1b17bff6e98df357016b8f12e9c4ed892 /bfd
parentc034e007d5227897fb787ae8338d72fd7de9650d (diff)
downloadgdb-838e70c548d07aa651332912e3d537ea0772c98e.zip
gdb-838e70c548d07aa651332912e3d537ea0772c98e.tar.gz
gdb-838e70c548d07aa651332912e3d537ea0772c98e.tar.bz2
2004-01-25 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm relocations against dynamic symbols.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-ia64.c30
2 files changed, 24 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 00748f3..57b09bc 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
+ relocations against dynamic symbols.
+
2004-01-23 Daniel Jacobowitz <drow@mvista.com>
* elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index c699922..c33aec1 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -3951,6 +3951,24 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (srel != NULL);
+ switch (r_type)
+ {
+ case R_IA64_IMM14:
+ case R_IA64_IMM22:
+ case R_IA64_IMM64:
+ /* ??? People shouldn't be doing non-pic code in
+ shared libraries nor dynamic executables. */
+ (*_bfd_error_handler)
+ (_("%s: non-pic code with imm relocation against dynamic symbol `%s'"),
+ bfd_archive_filename (input_bfd),
+ h->root.root.string);
+ ret_val = FALSE;
+ continue;
+
+ default:
+ break;
+ }
+
/* If we don't need dynamic symbol lookup, find a
matching RELATIVE relocation. */
dyn_r_type = r_type;
@@ -3978,17 +3996,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
default:
- /* We can't represent this without a dynamic symbol.
- Adjust the relocation to be against an output
- section symbol, which are always present in the
- dynamic symbol table. */
- /* ??? People shouldn't be doing non-pic code in
- shared libraries. Hork. */
- (*_bfd_error_handler)
- (_("%s: linking non-pic code in a shared library"),
- bfd_archive_filename (input_bfd));
- ret_val = FALSE;
- continue;
+ break;
}
dynindx = 0;
addend = value;