[Differential] [Request, 122 lines] D1967: Attempt to make libcxxrt's dwarf_eh work with strict alignment

dim (Dimitry Andric) phabric-noreply at FreeBSD.org
Wed Feb 25 22:10:37 UTC 2015


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


More information about the freebsd-arm mailing list