S/390: Get rid of assembler warning value truncated.

Message ID m4l4v0$d87$1@ger.gmane.org
State Superseded
Headers

Commit Message

Stefan Liebler Nov. 20, 2014, 4:30 p.m. UTC
  Hi,

this patch gets rid of Assembler message:
sysdeps/s390/s390-32/dl-machine.h:75:
Warning: value 0xffffffff7fffffea truncated to 0x7fffffea
in static inline function elf_machine_load_address,
which is only used in _dl_start function in elf/rtld.c.
The value was subtracted by 0x80000000 and is now anded with 0x7fffffff.

This patch does not change anything in ld.so.
Tested on s390.

Ok to commit?

Bye Stefan

---
2014-11-20  Stefan Liebler  <stli@linux.vnet.ibm.com>

	sysdeps/s390/s390-32/dl-machine.h (elf_machine_load_address):
	Use anding 0x7fffffff instead of subtracting 0x80000000.
  

Comments

Andreas Schwab Nov. 20, 2014, 4:43 p.m. UTC | #1
Stefan Liebler <stli@linux.vnet.ibm.com> writes:

> diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
> index 527233b..74939b8 100644
> --- a/sysdeps/s390/s390-32/dl-machine.h
> +++ b/sysdeps/s390/s390-32/dl-machine.h
> @@ -72,7 +72,7 @@ elf_machine_load_address (void)
>  
>    asm( "   bras  1,2f\n"
>         "1: .long _GLOBAL_OFFSET_TABLE_ - 1b\n"
> -       "   .long _dl_start - 1b - 0x80000000\n"
> +       "   .long (_dl_start - 1b) & 0x7fffffff\n"

This is only equivalent if _dl_start - 1b is always negative.

Andreas.
  

Patch

diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
index 527233b..74939b8 100644
--- a/sysdeps/s390/s390-32/dl-machine.h
+++ b/sysdeps/s390/s390-32/dl-machine.h
@@ -72,7 +72,7 @@  elf_machine_load_address (void)
 
   asm( "   bras  1,2f\n"
        "1: .long _GLOBAL_OFFSET_TABLE_ - 1b\n"
-       "   .long _dl_start - 1b - 0x80000000\n"
+       "   .long (_dl_start - 1b) & 0x7fffffff\n"
        "2: l     %0,4(1)\n"
        "   ar    %0,1\n"
        "   al    1,0(1)\n"