Blame SOURCES/gcc48-rh1312850.patch

4dd737
2016-05-26  Martin Sebor  <msebor@redhat.com>
4dd737
	    Jakub Jelinek  <jakub@redhat.com>
4dd737
4dd737
	* asan/asan_rtl.cc (InitializeHighMemEnd): Backport part of upstream
4dd737
	r221457 fix and typo fix from r206158.
4dd737
4dd737
--- libsanitizer/asan/asan_rtl.cc.jj	2013-03-04 12:44:18.000000000 +0100
4dd737
+++ libsanitizer/asan/asan_rtl.cc	2016-05-26 09:57:10.761973999 +0200
4dd737
@@ -308,11 +308,13 @@ static void InitializeHighMemEnd() {
4dd737
 # if defined(__powerpc64__)
4dd737
   // FIXME:
4dd737
   // On PowerPC64 we have two different address space layouts: 44- and 46-bit.
4dd737
-  // We somehow need to figure our which one we are using now and choose
4dd737
+  // We somehow need to figure out which one we are using now and choose
4dd737
   // one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.
4dd737
   // Note that with 'ulimit -s unlimited' the stack is moved away from the top
4dd737
   // of the address space, so simply checking the stack address is not enough.
4dd737
-  kHighMemEnd = (1ULL << 44) - 1;  // 0x00000fffffffffffUL
4dd737
+  // This should (does) work for both PowerPC64 Endian modes.
4dd737
+  kHighMemEnd =
4dd737
+      (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
4dd737
 # else
4dd737
   kHighMemEnd = (1ULL << 47) - 1;  // 0x00007fffffffffffUL;
4dd737
 # endif