[0/2] AArch64 DT_RELR support

Message ID cover.1716972656.git.szabolcs.nagy@arm.com
Headers
Series AArch64 DT_RELR support |

Message

Szabolcs Nagy May 29, 2024, 9:02 a.m. UTC
  Tests are separate so the core support is backportable
even if the latest readelf changes used by the tests
are missing.

Szabolcs Nagy (2):
  aarch64: Add DT_RELR support
  aarch64: Add some DT_RELR ld tests

 bfd/elfnn-aarch64.c                        | 429 ++++++++++++++++++++-
 bfd/elfxx-aarch64.h                        |  11 +
 ld/emulparams/aarch64elf.sh                |   2 +
 ld/emulparams/aarch64fbsd.sh               |   2 +
 ld/emulparams/aarch64linux.sh              |   2 +
 ld/testsuite/ld-aarch64/aarch64-elf.exp    |   6 +
 ld/testsuite/ld-aarch64/relr-align.d       |  22 ++
 ld/testsuite/ld-aarch64/relr-align.s       | 106 +++++
 ld/testsuite/ld-aarch64/relr-data-pie.d    |  18 +
 ld/testsuite/ld-aarch64/relr-data-shared.d |  18 +
 ld/testsuite/ld-aarch64/relr-data.s        |  71 ++++
 ld/testsuite/ld-aarch64/relr-got-pie.d     |  15 +
 ld/testsuite/ld-aarch64/relr-got-shared.d  |  15 +
 ld/testsuite/ld-aarch64/relr-got.s         |  40 ++
 14 files changed, 756 insertions(+), 1 deletion(-)
 create mode 100644 ld/testsuite/ld-aarch64/relr-align.d
 create mode 100644 ld/testsuite/ld-aarch64/relr-align.s
 create mode 100644 ld/testsuite/ld-aarch64/relr-data-pie.d
 create mode 100644 ld/testsuite/ld-aarch64/relr-data-shared.d
 create mode 100644 ld/testsuite/ld-aarch64/relr-data.s
 create mode 100644 ld/testsuite/ld-aarch64/relr-got-pie.d
 create mode 100644 ld/testsuite/ld-aarch64/relr-got-shared.d
 create mode 100644 ld/testsuite/ld-aarch64/relr-got.s
  

Comments

Nick Clifton May 29, 2024, 11:55 a.m. UTC | #1
Hi Szabolcs,

>   ld/testsuite/ld-aarch64/relr-got-pie.d     |  15 +

My testing has shown one new linker testsuite failure, for one,
unusual, aarch64 configuration:

   FAIL: ld-aarch64/relr-got-pie

The failure is just because of some unexpected offsets:

   regexp_diff match failure
   regexp "^Relocation section '\.rela\.dyn' at offset 0x100e8 contains 2 entries:$"
   line    "Relocation section '.rela.dyn' at offset 0x100f0 contains 2 entries:"

   regexp_diff match failure
   regexp "^Relocation section '\.relr\.dyn' at offset 0x10118 contains 2 entries which relocate 4 locations:$"
   line    "Relocation section '.relr.dyn' at offset 0x10120 contains 2 entries which relocate 4 locations:"

And the target is:

   aarch64_be-linux-gnu_ilp32

Given that this particular target already has lots of other unexpected
failures in the linker testsuite, I am not sure if you will want to
create a patch revision just to address this particular issue.

Cheers
   Nick
  
Nick Clifton May 29, 2024, 11:59 a.m. UTC | #2
Hi Szabolcs,

>   ld/testsuite/ld-aarch64/relr-got-pie.d     |  15 +

My testing has shown one new linker testsuite failure, for one,
unusual, aarch64 configuration:

   FAIL: ld-aarch64/relr-got-pie

The failure is just because of some unexpected offsets:

   regexp_diff match failure
   regexp "^Relocation section '\.rela\.dyn' at offset 0x100e8 contains 2 entries:$"
   line    "Relocation section '.rela.dyn' at offset 0x100f0 contains 2 entries:"

   regexp_diff match failure
   regexp "^Relocation section '\.relr\.dyn' at offset 0x10118 contains 2 entries which relocate 4 locations:$"
   line    "Relocation section '.relr.dyn' at offset 0x10120 contains 2 entries which relocate 4 locations:"

And the target is:

   aarch64_be-linux-gnu_ilp32

Given that this particular target already has lots of other unexpected
failures in the linker testsuite, I am not sure if you will want to
create a patch revision just to address this particular issue.

Cheers
   Nick
  
Szabolcs Nagy May 29, 2024, 3:07 p.m. UTC | #3
The 05/29/2024 12:55, Nick Clifton wrote:
> Hi Szabolcs,
> 
> >   ld/testsuite/ld-aarch64/relr-got-pie.d     |  15 +
> 
> My testing has shown one new linker testsuite failure, for one,
> unusual, aarch64 configuration:
> 
>   FAIL: ld-aarch64/relr-got-pie
> 
> The failure is just because of some unexpected offsets:
> 
>   regexp_diff match failure
>   regexp "^Relocation section '\.rela\.dyn' at offset 0x100e8 contains 2 entries:$"
>   line    "Relocation section '.rela.dyn' at offset 0x100f0 contains 2 entries:"
> 
>   regexp_diff match failure
>   regexp "^Relocation section '\.relr\.dyn' at offset 0x10118 contains 2 entries which relocate 4 locations:$"
>   line    "Relocation section '.relr.dyn' at offset 0x10120 contains 2 entries which relocate 4 locations:"
> 
> And the target is:
> 
>   aarch64_be-linux-gnu_ilp32
> 
> Given that this particular target already has lots of other unexpected
> failures in the linker testsuite, I am not sure if you will want to
> create a patch revision just to address this particular issue.

the test is forced to use lp64 abi and uses a linker script
to make sure the layout is fixed.. but i think the layout
changes slightly because of the longer interpreter name on
aarch64_be.

i will see if i can change the linker script so the addresses
are the same on _be.
  
Szabolcs Nagy May 30, 2024, 11:36 a.m. UTC | #4
The 05/29/2024 16:07, Szabolcs Nagy wrote:
> The 05/29/2024 12:55, Nick Clifton wrote:
> > Hi Szabolcs,
> > 
> > >   ld/testsuite/ld-aarch64/relr-got-pie.d     |  15 +
> > 
> > My testing has shown one new linker testsuite failure, for one,
> > unusual, aarch64 configuration:
> > 
> >   FAIL: ld-aarch64/relr-got-pie
> > 
> > The failure is just because of some unexpected offsets:
> > 
> >   regexp_diff match failure
> >   regexp "^Relocation section '\.rela\.dyn' at offset 0x100e8 contains 2 entries:$"
> >   line    "Relocation section '.rela.dyn' at offset 0x100f0 contains 2 entries:"
> > 
> >   regexp_diff match failure
> >   regexp "^Relocation section '\.relr\.dyn' at offset 0x10118 contains 2 entries which relocate 4 locations:$"
> >   line    "Relocation section '.relr.dyn' at offset 0x10120 contains 2 entries which relocate 4 locations:"
> > 
> > And the target is:
> > 
> >   aarch64_be-linux-gnu_ilp32
> > 
> > Given that this particular target already has lots of other unexpected
> > failures in the linker testsuite, I am not sure if you will want to
> > create a patch revision just to address this particular issue.
> 
> the test is forced to use lp64 abi and uses a linker script
> to make sure the layout is fixed.. but i think the layout
> changes slightly because of the longer interpreter name on
> aarch64_be.
> 
> i will see if i can change the linker script so the addresses
> are the same on _be.

i decided to just wildcard those offsets.