[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add types and values relative to RELR relocations
From: |
Mike Hommey |
Subject: |
Re: [PATCH] Add types and values relative to RELR relocations |
Date: |
Thu, 17 Aug 2023 17:44:44 +0900 |
On Thu, Aug 17, 2023 at 10:25:11AM +0200, Jose E. Marchesi wrote:
>
> 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_?
I... don't know how I managed to make this typo...
Mike