[v2] elf.h: Drop duplicate STO_RISCV_VARIANT_CC, and reorder DT_RISCV_*

Message ID 20230429170728.17185-1-palmer@rivosinc.com
State Superseded
Headers
Series [v2] elf.h: Drop duplicate STO_RISCV_VARIANT_CC, and reorder DT_RISCV_* |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Palmer Dabbelt April 29, 2023, 5:07 p.m. UTC
  I missed the update from last year that included these already, having
duplicates breaks the build due to redefinition errors like

    elf/elf.h:4013: error: macro STO_RISCV_VARIANT_CC redefined
    elf.h:3941: note: location of previous definition

Maskray points out that we've got these slightly out of order when
compared to other ports, so I've kept the lower STO_RISCV_VARIANT_CC and
moved the DT_RISCV_* symbols down.

Reported-by: Joseph S. Myers <joseph@codesourcery.com>
Fixes: 117e8b341c ("riscv: Resolve symbols directly for symbols with
STO_RISCV_VARIANT_CC.")
Link: https://inbox.sourceware.org/libc-alpha/mhng-0d9fb5a0-63fa-4b02-8029-7c20232f39ee@palmer-ri-x1c9/T/#t
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
This one's testing, my setup looks OK so I'll hold off a bit before
committing it.
---
 elf/elf.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
  

Patch

diff --git a/elf/elf.h b/elf/elf.h
index 4f65b5a32d..dd12f211d4 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -3933,13 +3933,6 @@  enum
 
 #define R_TILEGX_NUM		130
 
-/* RISC-V specific values for the Dyn d_tag field.  */
-#define DT_RISCV_VARIANT_CC	(DT_LOPROC + 1)
-#define DT_RISCV_NUM		2
-
-/* RISC-V specific values for the st_other field.  */
-#define STO_RISCV_VARIANT_CC 0x80
-
 /* RISC-V ELF Flags */
 #define EF_RISCV_RVC 			0x0001
 #define EF_RISCV_FLOAT_ABI 		0x0006
@@ -4009,6 +4002,10 @@  enum
 
 #define R_RISCV_NUM		59
 
+/* RISC-V specific values for the Dyn d_tag field.  */
+#define DT_RISCV_VARIANT_CC	(DT_LOPROC + 1)
+#define DT_RISCV_NUM		2
+
 /* RISC-V specific values for the st_other field.  */
 #define STO_RISCV_VARIANT_CC	0x80	/* Function uses variant calling
 					   convention */