This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] RL78 - fix ADDR16 relax
- From: DJ Delorie <dj at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 3 Mar 2015 23:15:25 -0000
- Subject: [binutils-gdb] RL78 - fix ADDR16 relax
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71eef2bd8dc3a37709908bf14a95c48b80c04c42
commit 71eef2bd8dc3a37709908bf14a95c48b80c04c42
Author: DJ Delorie <dj@redhat.com>
Date: Tue Mar 3 17:49:44 2015 -0500
RL78 - fix ADDR16 relax
* elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
there's a symbol.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf32-rl78.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 57bc637..72c9196 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-03 DJ Delorie <dj@redhat.com>
+
+ * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
+ there's a symbol.
+
2015-02-28 Alan Modra <amodra@gmail.com>
* elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 1bb5edc..acd82b9 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -2338,7 +2338,8 @@ rl78_elf_relax_section
}
- if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16)
+ if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16
+ && nrelocs > 0)
{
/*----------------------------------------------------------------------*/
/* Some insns have both a 16-bit address operand and an 8-bit