Skip to content

hppa: avoid TEXTREL in .eh_frame section#447

Merged
atgreen merged 1 commit intolibffi:masterfrom
trofi:master
Apr 27, 2019
Merged

hppa: avoid TEXTREL in .eh_frame section#447
atgreen merged 1 commit intolibffi:masterfrom
trofi:master

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Aug 29, 2018

Before the change hand-crafted .eh_frame section contained
ABS relocation and caused TEXTREL tag to be emitted:

$ ./configure --host=hppa2.0-unknown-linux-gnu LDFLAGS=-Wl,-z,text
$ make
...
/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/ld:
    read-only segment has dynamic relocations.

Link failure is caused by absolute address of FDEs
encoded into .eh_frame entries.

Fixed TEXTREL by using pcrel (instead of ABS) encoding
for absolute addresses (PIC code) by adding augmentation
information ("zR" CIE type).

All tests still pass on hppa2.0. The specific tests that still pass
and exercise this code path:
testsuite/libffi.call/unwindtest.cc
testsuite/libffi.call/unwindtest_ffi_call.cc

Signed-off-by: Sergei Trofimovich [email protected]

Before the change hand-crafted .eh_frame section contained
ABS relocation and caused TEXTREL tag to be emitted:

```
$ ./configure --host=hppa2.0-unknown-linux-gnu LDFLAGS=-Wl,-z,text
$ make
...
/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/ld:
    read-only segment has dynamic relocations.
```

Link failure is caused by absolute address of FDEs
encoded into .eh_frame entries.

Fixed TEXTREL by using pcrel (instead of ABS) encoding
for absolute addresses (__PIC__ code) by adding augmentation
information ("zR" CIE type).

All tests still pass on hppa2.0. The specific tests that still pass
and exercise this code path:
    testsuite/libffi.call/unwindtest.cc
    testsuite/libffi.call/unwindtest_ffi_call.cc

Signed-off-by: Sergei Trofimovich <[email protected]>
@atgreen atgreen merged commit fadf1eb into libffi:master Apr 27, 2019
jeremyhu added a commit to jeremyhu/libffi that referenced this pull request Apr 11, 2020
…o master

Reviewed-by: Mike Ash <[email protected]>
Reviewed-by: Matt Reda <[email protected]>

* commit '2284bfc111229c3af01722d9aab23056025a8e01': (22 commits)
  darwin arm64e: libunwind requires that the CFA match the value used to sign LR
  arm64e: Fix frame size to 40b to match earlier change in aarch64/ffi.c
  Add missing arch guards around ffi_find_closure_for_code_np
  fix mingw build and crashing bugs for Python Windows ARM64 (libffi#496)
  Clear the apt cache
  More debugging output
  Debug moxie builds in travis
  libffi: added ARM64 support for Windows (libffi#486)
  uuencode compressed log files for travis
  hppa: avoid TEXTREL in .eh_frame section (libffi#447)
  fix x86/x64 MSVC build (libffi#487)
  add support for 32-bit ARM on Windows (libffi#477)
  fix check for Linux/aarch64
  Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (libffi#450)
  Fix cfi checks for old compiler (libffi#453)
  changes for win32 on windows (libffi#468)
  aarch64: Flush code mapping in addition to data mapping (libffi#471)
  Remove -Os testing. No ABI impact, and helps trim log lengths.
  fix(configure): Correctly detect visibility("hidden") support on Darwin
  Fix Q registers parameter passing on ARM64
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants