https://bugs.kde.org/show_bug.cgi?id=398883

            Bug ID: 398883
           Summary: valgrind incorrectly assumes ABI on PowerPC based on
                    endianness
           Product: valgrind
           Version: 3.13.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: awil...@adelielinux.org
  Target Milestone: ---

valgrind (mainly coregrind, though there are a few misc bits in memcheck it
looks like) assumes ELFv1 ABI on big endian and ELFv2 ABI on little endian.

Neither of these assumptions are correct; the musl libc (used by Void, Adélie,
Alpine, Sabotage, and other Linux distros) uses ELFv2 ABI on big endian, and
older releases of OpenSuSE use ELFv1 ABI on little endian.

I plan on submitting a patch, either here or on Differential, in the coming
weeks.  My change plan is:


* add definition, VGP_ppc64_linux_abi1 and VGP_ppc64_linux_abi2

* abi1 is defined if (defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) ||
_CALL_ELF == 1) || (defined(VGP_ppc64le_linux) && defined(_CALL_ELF) &&
_CALL_ELF == 1)

* abi2 is defined if (defined(VGP_ppc64le_linux) && (!defined(_CALL_ELF) ||
_CALL_ELF == 2) || (defined(VGP_ppc64be_linux) && defined(_CALL_ELF) &&
_CALL_ELF == 2)

* then, in the C code, defined(VGP_ppc64le_linux) becomes
defined(VGP_ppc64_linux_abi2)

* and defined(VGP_ppc64be_linux) becomes defined(VGP_ppc64_linux_abi1)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to