[v3,1/6] elf.h, scripts: Don't error on duplicate DT_RISCV_NUM

Message ID 20230501234739.7264-2-palmer@rivosinc.com (mailing list archive)
State Superseded
Headers
Series elf.h: Fix and cleanup the RISC-V defines |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Palmer Dabbelt May 1, 2023, 11:47 p.m. UTC
  DT_RISCV_NUM is just the count of d_tag entries, so it's OK if it has
the same value as some other entry.  Other architectures allow this
duplication, do so for RISC-V as well.

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>
---
 elf/tst-glibcelf.py | 1 +
 scripts/glibcelf.py | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Andreas Schwab May 3, 2023, 12:54 p.m. UTC | #1
Ok.
  

Patch

diff --git a/elf/tst-glibcelf.py b/elf/tst-glibcelf.py
index 6142ca28ae..41d1b18022 100644
--- a/elf/tst-glibcelf.py
+++ b/elf/tst-glibcelf.py
@@ -182,6 +182,7 @@  DT_NUM
 DT_PPC64_NUM
 DT_PPC_NUM
 DT_PROCNUM
+DT_RISCV_NUM
 DT_SPARC_NUM
 DT_VALNUM
 DT_VALRNGHI
diff --git a/scripts/glibcelf.py b/scripts/glibcelf.py
index 6f48eee129..9d36ea60cd 100644
--- a/scripts/glibcelf.py
+++ b/scripts/glibcelf.py
@@ -450,6 +450,7 @@  DT_IA_64_NUM
 DT_MIPS_NUM
 DT_PPC_NUM
 DT_PPC64_NUM
+DT_RISCV_NUM
 DT_SPARC_NUM
 '''.strip().split()
 _register_elf_h(DtAARCH64, prefix='DT_AARCH64_', skip=_dt_skip, parent=Dt)