This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: [PATCH] arm: ensure symbol is a thumb symbol in new binutils


Hi Romain,

>>   https://sourceware.org/bugzilla/show_bug.cgi?id=21458
> 
> What's the status of this bug?

It was sidelined. :-(  Sorry.

> Some users reported a runtime issue with the linux kernel boot for Cortex-M
> target: https://bugs.buildroot.org/show_bug.cgi?id=11051

I think that part of the problem is that the kernel people are 
asking for the (adr affecting part of the) patch to be reverted, 
but they have not suggested a way to address the issue raised in
the PR.  (From comment #6 onwards).

One thing that did occur to me is that the adr handling code
in the assembler does not check to see if the bottom bit has 
already been set, so maybe this is part of the problem.  Are
you able to test out an assembler patch and see if it makes
a difference ?  

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index dbaf1627bb..c682ceabd3 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -8423,7 +8423,7 @@ do_adr (void)
       && inst.reloc.exp.X_add_symbol != NULL
       && S_IS_DEFINED (inst.reloc.exp.X_add_symbol)
       && THUMB_IS_FUNC (inst.reloc.exp.X_add_symbol))
-    inst.reloc.exp.X_add_number += 1;
+    inst.reloc.exp.X_add_number |= 1;
 }
 
 /* This is a pseudo-op of the form "adrl rd, label" to be converted

If that does not help, then I think that the only thing to do is
to add a command line option to control the behaviour of the ADR
pseudo-op and a configure time switch to set the default for this
option.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]