diff options
author | Ryan Prichard <rprichard@google.com> | 2020-09-24 19:20:31 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2020-09-24 22:01:32 -0700 |
commit | bcef897b6dd45eef0ef7342be7c8d376e16093a0 (patch) | |
tree | c08064b5188dd080a1c908d403b1041e9c2d2082 /libc/stdio/stdio.cpp | |
parent | bda85584d1109792da868cb13dae65512c6f2aa9 (diff) |
Enable arm64 .eh_frame terminator, align it to 4
Every architecture that uses .eh_frame needs a terminator at the end to
ensure that an unwinder library doesn't read past the end of the
section. This can happen when the unwinder looks up a PC that doesn't
have a matching FDE. Both LLVM libunwind and libgcc fall back to an
.eh_frame scan if the .eh_frame_hdr search table scan fails.
By convention, this terminator section is aligned to 4, even on 64-bit
targets. e.g. Both libgcc and compiler-rt have a crtend with 4-byte
.eh_frame alignment on arm64 and x86_64.
In practice, lld strips off the terminator from input object files and
adds one unconditionally to the output, but bfd/gold still require a
crtend with a terminator.
References:
- https://reviews.llvm.org/D86256
- https://reviews.llvm.org/D87750
- https://sourceware.org/bugzilla/show_bug.cgi?id=2655
Test: examine crtend.o and crtend_so.o with `readelf -SW` and \
`objdump -Wf`
Change-Id: Ib8478ee446ad806898aa7147a6208d384c7516d5
Diffstat (limited to 'libc/stdio/stdio.cpp')
0 files changed, 0 insertions, 0 deletions