* [patch] rl78: fix relax type logic
@ 2014-08-26 18:04 DJ Delorie
2014-08-26 19:20 ` Sergio Durigan Junior
0 siblings, 1 reply; 3+ messages in thread
From: DJ Delorie @ 2014-08-26 18:04 UTC (permalink / raw)
To: binutils
Committed.
* elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for
relaxation type.
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 9124e0a..2a5ec99 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -2199,7 +2199,7 @@ rl78_elf_relax_section
61 F3 EF ad SKNH ; BR $rel8
*/
- if (irel->r_addend & RL78_RELAXA_BRA)
+ if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_BRA)
{
/* SKIP opcodes that skip non-branches will have a relax tag
but no corresponding symbol to relax against; we just
@@ -2334,7 +2334,7 @@ rl78_elf_relax_section
}
- if (irel->r_addend & RL78_RELAXA_ADDR16)
+ if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16)
{
/*----------------------------------------------------------------------*/
/* Some insns have both a 16-bit address operand and an 8-bit
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] rl78: fix relax type logic
2014-08-26 18:04 [patch] rl78: fix relax type logic DJ Delorie
@ 2014-08-26 19:20 ` Sergio Durigan Junior
2014-08-26 21:02 ` DJ Delorie
0 siblings, 1 reply; 3+ messages in thread
From: Sergio Durigan Junior @ 2014-08-26 19:20 UTC (permalink / raw)
To: DJ Delorie; +Cc: binutils
On Tuesday, August 26 2014, DJ Delorie wrote:
> Committed.
>
> * elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for
> relaxation type.
Hi DJ,
I'm seeing:
../../binutils-gdb-pr17235/bfd/elf32-rl78.c: In function ‘rl78_elf_relax_section’:
../../binutils-gdb-pr17235/bfd/elf32-rl78.c:2202:29: error: ‘RL78_RELAXA_MASK’ undeclared (first use in this function)
if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_BRA)
^
grepping for RL78_RELAXA_MASK shows only places where it is used, not
declared. Maybe there's a following commit coming? :-)
--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] rl78: fix relax type logic
2014-08-26 19:20 ` Sergio Durigan Junior
@ 2014-08-26 21:02 ` DJ Delorie
0 siblings, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2014-08-26 21:02 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: binutils
> grepping for RL78_RELAXA_MASK shows only places where it is used, not
> declared. Maybe there's a following commit coming? :-)
There is now :-) (our internal working tree is a patch or two ahead of
fsf)
* rl78.h (RL78_RELAXA_MASK): New. Relax types are enums, not bits
diff --git a/include/elf/rl78.h b/include/elf/rl78.h
index 342932d..1a526fa 100644
--- a/include/elf/rl78.h
+++ b/include/elf/rl78.h
@@ -109,6 +109,7 @@ END_RELOC_NUMBERS (R_RL78_max)
#define E_FLAG_RL78_G10 (1 << 2) /* CPU is missing register banks 1-3, so uses different ABI. */
/* These define the addend field of R_RL78_RH_RELAX relocations. */
+#define RL78_RELAXA_MASK 0x000000f0 /* Mask for relax types */
#define RL78_RELAXA_BRA 0x00000010 /* Any type of branch (must be decoded). */
#define RL78_RELAXA_ADDR16 0x00000020 /* addr16->sfr/saddr opportunity */
#define RL78_RELAXA_RNUM 0x0000000f /* Number of associated relocations. */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-26 21:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 18:04 [patch] rl78: fix relax type logic DJ Delorie
2014-08-26 19:20 ` Sergio Durigan Junior
2014-08-26 21:02 ` DJ Delorie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).