summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2004-06-30 03:51:25 +0000
committerH.J. Lu <hjl@lucon.org>2004-06-30 03:51:25 +0000
commit1e8e344e07c3d807d3ee553ed1873d82b578e9d9 (patch)
tree0cf40548975cd740a2bc5b47c78b9e44f90b3716
parent54193db6ff3be85683143b7c89e555d3a212b363 (diff)
downloadbinutils-redhat-1e8e344e07c3d807d3ee553ed1873d82b578e9d9.tar.gz
2004-06-29 H.J. Lu <hongjiu.lu@intel.com>
PR 240 * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch in .init/.fini sections.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-ia64.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3c0e12a855..78bcea55e3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR 240
+ * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch
+ in .init/.fini sections.
+
2004-06-29 Bob Wilson <bob.wilson@acm.org>
* elf32-xtensa.c (elf_xtensa_relocate_section): Use
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 6f0c06e0ab..d8c4b5761b 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -943,6 +943,19 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
{
bfd_signed_vma offset;
+ /* We can't put a trampoline in a .init/.fini section. Issue
+ an error. */
+ if (strcmp (sec->output_section->name, ".init") == 0
+ || strcmp (sec->output_section->name, ".fini") == 0)
+ {
+ (*_bfd_error_handler)
+ (_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."),
+ bfd_archive_filename (sec->owner),
+ (unsigned long) roff, sec->name);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+
reladdr = (sec->output_section->vma
+ sec->output_offset
+ roff) & (bfd_vma) -4;