In emutls.c we introduce a new type to represent an address, to ensure
we have the same distinction between pointer and address here as
everywhere else. This allows us to remove a provenance warning on a
binary operation between two capabilities.
One point of note is that we use __attribute__((mode(address))) rather
than ptraddr_t. This is because ptraddr_t is not necessarily defined
for all targets, while __attribute__((mode(address))) is. We care about
this more inside libgcc than in other software since this software is
supposed to be as portable as GCC is.
In the GCC C-language personality function we avoid some provenance warnings
by using _Unwind_Address in some binary operations, and we cast an
_Unwind_Ptr to a void * before passing it to
__builtin_code_address_from_pointer.
In unwind-dw2 and unwind-dw2-fde we just need to make the difference
between an address and a pointer clear for the compiler. We record
addresses in many structures since they are smaller and we only need the
address. Our functions for reading in encoded values need to be able to
return capabilities because we can have capabilities stored (indirectly)
in the debug information. Hence we now need to cast from the "read"
value type to the "for use" value type.
Avoid unaligned warnings in `read_encoded_value_with_base`. We know
the union we define is not aligned for capabilities, but we handle it
manually ourselves (there is never a capability directly in the debug
information, but there can be `void *`'s for other backends).
Mark the __EH_FRAME_BEGIN__ symbol as being used in the inline assembly
that the purecap implementation of get_eh_frame_begin is implemented
with. This avoids a warning, and avoids the possibility of the variable
being optimised away.
Add the EH_FRAME_SECTION_CONST macro (which expands to `const`
or the empty string depending on configuration settings) to the
declaration of `get_eh_frame_begin` so the function does not discard the
`const` attribute.
We adjust our `asm` directive so that it indicates we are
using the __EH_FRAME_BEGIN__ symbol as this avoids an unused variable
warning.