[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add types and values relative to RELR relocations
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] Add types and values relative to RELR relocations |
Date: |
Thu, 17 Aug 2023 10:25:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello Mike.
Thanks for the patch.
I see that RELR relocations are not still part of the sysv gABI
(proposal at https://groups.google.com/g/generic-abi/c/bX460iggiKg) but
looks like it will make it, so it is nice to have it supported in the
ELF pickle.
> ---
> elf-32.pk | 4 ++++
> elf-64.pk | 4 ++++
> elf-common.pk | 13 ++++++++++++-
> 3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/elf-32.pk b/elf-32.pk
> index 65420e7..ddf390f 100644
> --- a/elf-32.pk
> +++ b/elf-32.pk
> @@ -61,6 +61,10 @@ type Elf32_Rela =
> Elf_Sword r_addend;
> };
>
> +/* ELF32 RELR relocation entry. */
> +
> +type Elf32_Relr = Elf_Word;
> +
> /* ELF32 symbol. */
>
> type Elf32_Sym =
> diff --git a/elf-64.pk b/elf-64.pk
> index fb35554..a708828 100644
> --- a/elf-64.pk
> +++ b/elf-64.pk
> @@ -69,6 +69,10 @@ type Elf64_Rela =
> Elf64_Sxword r_addend;
> };
>
> +/* ELF64 RELR relocation entry. */
> +
> +type Elf64_Relr = Elf64_Xword;
> +
> /* ELF64 symbol. */
>
> type Elf64_Sym =
> diff --git a/elf-common.pk b/elf-common.pk
> index 7b1727d..6a1355a 100644
> --- a/elf-common.pk
> +++ b/elf-common.pk
> @@ -997,7 +997,7 @@ var ELF_DT_NULL = 0U, /* Tags the end of the dynamic
> array. */
> dynamic linker's symbol resolution algorithm for references
> within the library. */
> ELF_DT_SYMBOLIC = 16U,
> - /* d_ptr holds the address of a relocation table containing rela
> + /* d_ptr holds the address of a relocation table containing REL
> relocations. If this element is present, the dynamic structure
> must also have ELF_DT_RELSZ and ELF_DT_RELENT elements. */
> ELF_DT_REL = 17U,
> @@ -1066,6 +1066,16 @@ var ELF_DT_NULL = 0U, /* Tags the end of the dynamic
> array. */
> associated with the dynamic symbol table referenced by the
> ELF_DT_SYMTAB element. */
> ELF_DT_SYMTAB_SHNDX = 34U,
> + /* d_val holds the total size, in bytes, of the ELF_DT_RELR relocation
> + entry. */
> + ELF_DL_RELRSZ = 35U,
> + /* d_ptr holds the address of a relocation table containing RELR
> + relocations. If this element is present, the dynamic structure
> + must also have ELF_DT_RELRSZ and ELF_DT_RELRENT elements. */
> + ELF_DL_RELR = 36U,
> + /* d_val holds the size, in bytes, of the ELF_DT_RELR relocation
> + entry. */
> + ELF_DL_RELRENT = 37U,
Why are these new dynamic tags using the ELF_DL prefix instead of
the customary ELF_DT_?
Also, please add a config entry for them (in elf_config.add_enum for
dynamic-tags).
> ELF_DT_LOOS = 0x6000_000dU,
> ELF_DT_HIOS = 0x6fff_f000U,
> ELF_DT_LOPROC = 0x7000_0000U,
> @@ -1158,6 +1168,7 @@ var ELF_SHT_NULL = 0U,
> ELF_SHT_PREINIT_ARRAY = 16U,
> ELF_SHT_GROUP = 17U,
> ELF_SHT_SYMTAB_SHNDX = 18U,
> + ELF_SHT_RELR = 19U,
This needs a config entry (in elf_config.add_enum for section-types).
> ELF_SHT_LOOS = 0x6000_0000U,
> ELF_SHT_HIOS = 0x6fff_ffffU,
> ELF_SHT_LOUSER = 0x8000_0000U,