Date: Wed, 25 Feb 2015 22:10:36 +0000 From: "dim (Dimitry Andric)" <phabric-noreply@FreeBSD.org> To: freebsd-arm@freebsd.org Subject: [Differential] [Request, 122 lines] D1967: Attempt to make libcxxrt's dwarf_eh work with strict alignment Message-ID: <differential-rev-PHID-DREV-2dch6afcj5u7ayk2c67t-req@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
dim created this revision. dim added reviewers: andrew, bapt, ian, theraven. dim added a subscriber: freebsd-arm. REVISION SUMMARY In the thread starting here: https://lists.freebsd.org/pipermail/freebsd-arm/2015-January/009998.html Daisuke Aoyama describes how libcxxrt does not properly handle parsing an exception table on an RPi (e.g. arm). This is because parts of dwarf_eh.h read 16 bit, 32 bit and 64 bit values directly from possibly unaligned addresses. He posted a workaround patch here: https://lists.freebsd.org/pipermail/freebsd-arm/2015-January/010014.html but it is incomplete, as it does not handle the 16 and 64 bit cases, nor does it work for other architectures with strict alignment. Here is another attempt, where I put the reading of different sized objects into their own static inline functions, and try to handle alignment and endianness properly. This seems to work on i386 and amd64, but I can't test arm and/or mips myself. Also, I now assume the __NO_STRICT_ALIGNMENT and __LITTLE_ENDIAN__ macros are available, and works as expected. That shoudl probably be refined before we send this upstream. Unfortunately these are both non-standard, and there seems to be no reliable way of determining them portably. TEST PLAN Build and install on various arches, with and without strict alignment, and with little and big endian ordering. BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D1967 AFFECTED FILES contrib/libcxxrt/dwarf_eh.h To: dim, andrew, bapt, ian, theraven Cc: freebsd-arm
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?differential-rev-PHID-DREV-2dch6afcj5u7ayk2c67t-req>