[1/2] aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

Message ID 84aa1cdf-c988-fdba-0628-ae9d242dc8ca@arm.com
State New
Headers show
Series
  • aarch64: add STO_AARCH64_VARIANT_PCS support
Related show

Commit Message

Szabolcs Nagy May 23, 2019, 11:19 a.m.
STO_AARCH64_VARIANT_PCS is a non-visibility st_other flag for marking
symbols that reference functions that may follow a variant PCS with
different register usage convention from the base PCS.

DT_AARCH64_VARIANT_PCS is a dynamic tag that marks ELF modules that
have R_*_JUMP_SLOT relocations for symbols marked with
STO_AARCH64_VARIANT_PCS (i.e. have variant PCS calls via a PLT).

2019-05-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* elf/elf.h (STO_AARCH64_VARIANT_PCS): Define.
	(DT_AARCH64_VARIANT_PCS): Define.

Comments

Szabolcs Nagy June 3, 2019, 3:29 p.m. | #1
On 23/05/2019 12:19, Szabolcs Nagy wrote:
> STO_AARCH64_VARIANT_PCS is a non-visibility st_other flag for marking

> symbols that reference functions that may follow a variant PCS with

> different register usage convention from the base PCS.

> 

> DT_AARCH64_VARIANT_PCS is a dynamic tag that marks ELF modules that

> have R_*_JUMP_SLOT relocations for symbols marked with

> STO_AARCH64_VARIANT_PCS (i.e. have variant PCS calls via a PLT).

> 

> 2019-05-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

> 

> 	* elf/elf.h (STO_AARCH64_VARIANT_PCS): Define.

> 	(DT_AARCH64_VARIANT_PCS): Define.

> 



i'd like to commit this patchset, but it modifies public elf.h

i assume it is ok to commit now that the same definitions are
in binutils.

if there are no complaints i'll push the patches tomorrow.
Florian Weimer June 3, 2019, 5:26 p.m. | #2
* Szabolcs Nagy:

> On 23/05/2019 12:19, Szabolcs Nagy wrote:

>> STO_AARCH64_VARIANT_PCS is a non-visibility st_other flag for marking

>> symbols that reference functions that may follow a variant PCS with

>> different register usage convention from the base PCS.

>> 

>> DT_AARCH64_VARIANT_PCS is a dynamic tag that marks ELF modules that

>> have R_*_JUMP_SLOT relocations for symbols marked with

>> STO_AARCH64_VARIANT_PCS (i.e. have variant PCS calls via a PLT).

>> 

>> 2019-05-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

>> 

>> 	* elf/elf.h (STO_AARCH64_VARIANT_PCS): Define.

>> 	(DT_AARCH64_VARIANT_PCS): Define.

>> 

>

>

> i'd like to commit this patchset, but it modifies public elf.h

>

> i assume it is ok to commit now that the same definitions are

> in binutils.

>

> if there are no complaints i'll push the patches tomorrow.


I've already told you to use a new relocation type for this.

If you do not do this now, you *will* cause problems down the road.

Thanks,
Florian

Patch

diff --git a/elf/elf.h b/elf/elf.h
index bb13c870e2..ee7c779769 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -2864,6 +2864,13 @@  enum
 #define R_AARCH64_TLSDESC      1031	/* TLS Descriptor.  */
 #define R_AARCH64_IRELATIVE	1032	/* STT_GNU_IFUNC relocation.  */
 
+/* AArch64 specific values for the Dyn d_tag field.  */
+#define DT_AARCH64_VARIANT_PCS	(DT_LOPROC + 5)
+#define DT_AARCH64_NUM		6
+
+/* AArch64 specific values for the st_other field.  */
+#define STO_AARCH64_VARIANT_PCS 0x04
+
 /* ARM relocs.  */
 
 #define R_ARM_NONE		0	/* No reloc */