diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-06-06 14:54:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-06-06 14:54:37 +0200 |
commit | c1072919fa328d0400a76c29d47cf2c74052a87a (patch) | |
tree | c7831409dcc4bbd3c70e271018b3f79d6d65dfbf /c | |
parent | bsps/powerpc: Fix potential relocation truncation (diff) | |
download | rtems-c1072919fa328d0400a76c29d47cf2c74052a87a.tar.bz2 |
Revert "bsps/powerpc: Fix potential relocation truncation"
This reverts commit d9ff8b3e687a0ec56cac6463ba01ba7775eccd41.
It is not that simple:
https://sourceware.org/ml/binutils/2014-06/msg00062.html
On Fri, Jun 06, 2014 at 01:31:48PM +0200, Sebastian Huber wrote:
> On 2014-06-06 13:23, Sebastian Huber wrote:
> >Ok, so this "cmplwi cr0, rX, ppc_exc_lock_std@sdarel" is illegal,
> >since
> >ppc_exc_lock_std@sdarel is signed and the immediate is unsigned
> >16-bit? The
> >assembler doesn't issue a warning about this.
> >
> >Exists there a way to rescue this cmplwi hack without relaxing the
> >overflow
> >checks?
>
> Hm, sorry, it was surprisingly simple. This works:
>
> "cmplwi cr0, rX, ppc_exc_lock_std@sdarel@l"
>
> I was not aware that you can add several @ in a row.
That is the wrong thing to use here. sdarel@l translates to a VLE
reloc which applies to a split 16-bit field in VLE insns.
You want
cmpwi cr0, rX, ppc_exc_lock_std@sdarel
to properly compare a 16-bit signed number from sym@sdarel.
Note that the assembler does error if you write something like
cmplwi 3,-30000
or
cmpwi 3,40000
so what the linker is now doing is extending this behaviour to link
time.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h index 9a303f7b23..0e3bc96895 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h +++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h @@ -168,7 +168,7 @@ ppc_exc_min_prolog_sync_\_NAME: * if what's left compares against the 'ppc_exc_lock_std@sdarel' * address offset then we have a match... */ - cmplwi cr0, \_REG, ppc_exc_lock_std@sdarel@l + cmplwi cr0, \_REG, ppc_exc_lock_std@sdarel .endm |