This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fwd: [PATCH] arm: ensure symbol is a thumb symbol in new binutils
- From: Nick Clifton <nickc at redhat dot com>
- To: Romain Naour <romain dot naour at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 31 May 2018 14:00:53 +0100
- Subject: Re: Fwd: [PATCH] arm: ensure symbol is a thumb symbol in new binutils
- References: <20171121172751.29545-1-Jason@zx2c4.com> <20171121173857.GJ31757@n2100.armlinux.org.uk> <CAHmME9quDFbdOR9hKRz-Px=Mh3FvYEyhVrs4V_+JT+GjDajMrA@mail.gmail.com> <20171121174942.GK31757@n2100.armlinux.org.uk> <CAHmME9oMTNJFnOwfhu26QSRSP92Axbc-+v9cCPsTKxekZvGvxg@mail.gmail.com> <20171123103518.GL31757@n2100.armlinux.org.uk> <CAHmME9qBxgDV-HGeqj75ohr=4Bf+TD73PcC0DUqTRh5PTOKyhQ@mail.gmail.com> <20171123140228.GP31757@n2100.armlinux.org.uk> <CAKv+Gu8TJi8qSWAkL231WhQkWxK+vSQm2tnQn_qN-2wdFaNaEA@mail.gmail.com> <765227b5-981d-0cea-c831-73cfe2f58721@redhat.com> <aaf57bb5-13e6-852c-0f67-f72aedef0e79@gmail.com>
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