76b6d9
Downstream-only adjustments to scripts/glibcelf.py.  We do not have
76b6d9
CSKY nor RISC-V constants in <elf.h>, so glibcelf cannot extract
76b6d9
those.  PT_AARCH64_* constants are missing as well.
76b6d9
76b6d9
Adjust elf/tst-glibcelf.py to use PT_MIPS_OPTIONS instead of
76b6d9
PT_AARCH64_MEMTAG_MTE for testing.  It has the same numeric value
76b6d9
(0x70000002).
76b6d9
76b6d9
diff --git a/elf/tst-glibcelf.py b/elf/tst-glibcelf.py
76b6d9
index a5bff45eae55edea..9cb0861589d6ae2e 100644
76b6d9
--- a/elf/tst-glibcelf.py
76b6d9
+++ b/elf/tst-glibcelf.py
76b6d9
@@ -75,15 +75,17 @@ def check_basic():
76b6d9
     if repr(glibcelf.Pt(17609)) != 'Pt(17609)':
76b6d9
         error('repr(Pt(17609))')
76b6d9
 
76b6d9
-    if glibcelf.Pt('PT_AARCH64_MEMTAG_MTE') \
76b6d9
-       is not glibcelf.Pt.PT_AARCH64_MEMTAG_MTE:
76b6d9
-        error('PT_AARCH64_MEMTAG_MTE identity')
76b6d9
-    if glibcelf.Pt(0x70000002) is glibcelf.Pt.PT_AARCH64_MEMTAG_MTE:
76b6d9
+    # Note: Upstream uses PT_AARCH64_MEMTAG_MTE instead of PT_MIPS_OPTIONS.
76b6d9
+    # PT_AARCH64_MEMTAG_MTE is not yet available downstream.
76b6d9
+    if glibcelf.Pt('PT_MIPS_OPTIONS') \
76b6d9
+       is not glibcelf.Pt.PT_MIPS_OPTIONS:
76b6d9
+        error('PT_MIPS_OPTIONS identity')
76b6d9
+    if glibcelf.Pt(0x70000002) is glibcelf.Pt.PT_MIPS_OPTIONS:
76b6d9
         error('Pt(0x70000002) identity')
76b6d9
-    if glibcelf.PtAARCH64(0x70000002) is not glibcelf.Pt.PT_AARCH64_MEMTAG_MTE:
76b6d9
-        error('PtAARCH64(0x70000002) identity')
76b6d9
-    if glibcelf.Pt.PT_AARCH64_MEMTAG_MTE.short_name != 'AARCH64_MEMTAG_MTE':
76b6d9
-        error('PT_AARCH64_MEMTAG_MTE short name')
76b6d9
+    if glibcelf.PtMIPS(0x70000002) is not glibcelf.Pt.PT_MIPS_OPTIONS:
76b6d9
+        error('PtMIPS(0x70000002) identity')
76b6d9
+    if glibcelf.Pt.PT_MIPS_OPTIONS.short_name != 'MIPS_OPTIONS':
76b6d9
+        error('PT_MIPS_OPTIONS short name')
76b6d9
 
76b6d9
     # Special cases for int-like Shn.
76b6d9
     if glibcelf.Shn(32) == glibcelf.Shn.SHN_XINDEX:
76b6d9
diff --git a/scripts/glibcelf.py b/scripts/glibcelf.py
76b6d9
index 59aab56ecf9deb3e..5980d7cc906005e2 100644
76b6d9
--- a/scripts/glibcelf.py
76b6d9
+++ b/scripts/glibcelf.py
76b6d9
@@ -306,23 +306,17 @@ class ShtALPHA(Sht):
76b6d9
     """Supplemental SHT_* constants for EM_ALPHA."""
76b6d9
 class ShtARM(Sht):
76b6d9
     """Supplemental SHT_* constants for EM_ARM."""
76b6d9
-class ShtCSKY(Sht):
76b6d9
-    """Supplemental SHT_* constants for EM_CSKY."""
76b6d9
 class ShtIA_64(Sht):
76b6d9
     """Supplemental SHT_* constants for EM_IA_64."""
76b6d9
 class ShtMIPS(Sht):
76b6d9
     """Supplemental SHT_* constants for EM_MIPS."""
76b6d9
 class ShtPARISC(Sht):
76b6d9
     """Supplemental SHT_* constants for EM_PARISC."""
76b6d9
-class ShtRISCV(Sht):
76b6d9
-    """Supplemental SHT_* constants for EM_RISCV."""
76b6d9
 _register_elf_h(ShtALPHA, prefix='SHT_ALPHA_', parent=Sht)
76b6d9
 _register_elf_h(ShtARM, prefix='SHT_ARM_', parent=Sht)
76b6d9
-_register_elf_h(ShtCSKY, prefix='SHT_CSKY_', parent=Sht)
76b6d9
 _register_elf_h(ShtIA_64, prefix='SHT_IA_64_', parent=Sht)
76b6d9
 _register_elf_h(ShtMIPS, prefix='SHT_MIPS_', parent=Sht)
76b6d9
 _register_elf_h(ShtPARISC, prefix='SHT_PARISC_', parent=Sht)
76b6d9
-_register_elf_h(ShtRISCV, prefix='SHT_RISCV_', parent=Sht)
76b6d9
 _register_elf_h(Sht, ranges=True,
76b6d9
                 skip='SHT_LOSUNW SHT_HISUNW SHT_LOUSER SHT_HIUSER'.split())
76b6d9
 
76b6d9
@@ -392,8 +386,6 @@ _register_elf_h(Stt, ranges=True)
76b6d9
 class Pt(_TypedConstant):
76b6d9
     """ELF program header types.  Type of Phdr.p_type."""
76b6d9
     prefix = 'PT_'
76b6d9
-class PtAARCH64(Pt):
76b6d9
-    """Supplemental PT_* constants for EM_AARCH64."""
76b6d9
 class PtARM(Pt):
76b6d9
     """Supplemental PT_* constants for EM_ARM."""
76b6d9
 class PtHP(Pt):
76b6d9
@@ -404,15 +396,11 @@ class PtMIPS(Pt):
76b6d9
     """Supplemental PT_* constants for EM_MIPS."""
76b6d9
 class PtPARISC(Pt):
76b6d9
     """Supplemental PT_* constants for EM_PARISC."""
76b6d9
-class PtRISCV(Pt):
76b6d9
-    """Supplemental PT_* constants for EM_RISCV."""
76b6d9
-_register_elf_h(PtAARCH64, prefix='PT_AARCH64_', parent=Pt)
76b6d9
 _register_elf_h(PtARM, prefix='PT_ARM_', parent=Pt)
76b6d9
 _register_elf_h(PtHP, prefix='PT_HP_', parent=Pt)
76b6d9
 _register_elf_h(PtIA_64, prefix='PT_IA_64_', parent=Pt)
76b6d9
 _register_elf_h(PtMIPS, prefix='PT_MIPS_', parent=Pt)
76b6d9
 _register_elf_h(PtPARISC, prefix='PT_PARISC_', parent=Pt)
76b6d9
-_register_elf_h(PtRISCV, prefix='PT_RISCV_', parent=Pt)
76b6d9
 _register_elf_h(Pt, skip='PT_LOSUNW PT_HISUNW'.split(), ranges=True)
76b6d9
 
76b6d9
 class Dt(_TypedConstant):
76b6d9
@@ -432,8 +420,6 @@ class DtPPC(Dt):
76b6d9
     """Supplemental DT_* constants for EM_PPC."""
76b6d9
 class DtPPC64(Dt):
76b6d9
     """Supplemental DT_* constants for EM_PPC64."""
76b6d9
-class DtRISCV(Dt):
76b6d9
-    """Supplemental DT_* constants for EM_RISCV."""
76b6d9
 class DtSPARC(Dt):
76b6d9
     """Supplemental DT_* constants for EM_SPARC."""
76b6d9
 _dt_skip = '''
76b6d9
@@ -456,7 +442,6 @@ _register_elf_h(DtIA_64, prefix='DT_IA_64_', skip=_dt_skip, parent=Dt)
76b6d9
 _register_elf_h(DtMIPS, prefix='DT_MIPS_', skip=_dt_skip, parent=Dt)
76b6d9
 _register_elf_h(DtPPC, prefix='DT_PPC_', skip=_dt_skip, parent=Dt)
76b6d9
 _register_elf_h(DtPPC64, prefix='DT_PPC64_', skip=_dt_skip, parent=Dt)
76b6d9
-_register_elf_h(DtRISCV, prefix='DT_RISCV_', skip=_dt_skip, parent=Dt)
76b6d9
 _register_elf_h(DtSPARC, prefix='DT_SPARC_', skip=_dt_skip, parent=Dt)
76b6d9
 _register_elf_h(Dt, skip=_dt_skip, ranges=True)
76b6d9
 del _dt_skip