NT_GNU_BUILD_ATTRIBUTE_FUNC = 0x101,
};
+// Core note types
+enum : unsigned {
+ NT_PRSTATUS = 1,
+ NT_FPREGSET = 2,
+ NT_PRPSINFO = 3,
+ NT_TASKSTRUCT = 4,
+ NT_AUXV = 6,
+ NT_PSTATUS = 10,
+ NT_FPREGS = 12,
+ NT_PSINFO = 13,
+ NT_LWPSTATUS = 16,
+ NT_LWPSINFO = 17,
+ NT_WIN32PSTATUS = 18,
+
+ NT_PPC_VMX = 0x100,
+ NT_PPC_VSX = 0x102,
+ NT_PPC_TAR = 0x103,
+ NT_PPC_PPR = 0x104,
+ NT_PPC_DSCR = 0x105,
+ NT_PPC_EBB = 0x106,
+ NT_PPC_PMU = 0x107,
+ NT_PPC_TM_CGPR = 0x108,
+ NT_PPC_TM_CFPR = 0x109,
+ NT_PPC_TM_CVMX = 0x10a,
+ NT_PPC_TM_CVSX = 0x10b,
+ NT_PPC_TM_SPR = 0x10c,
+ NT_PPC_TM_CTAR = 0x10d,
+ NT_PPC_TM_CPPR = 0x10e,
+ NT_PPC_TM_CDSCR = 0x10f,
+
+ NT_386_TLS = 0x200,
+ NT_386_IOPERM = 0x201,
+ NT_X86_XSTATE = 0x202,
+
+ NT_S390_HIGH_GPRS = 0x300,
+ NT_S390_TIMER = 0x301,
+ NT_S390_TODCMP = 0x302,
+ NT_S390_TODPREG = 0x303,
+ NT_S390_CTRS = 0x304,
+ NT_S390_PREFIX = 0x305,
+ NT_S390_LAST_BREAK = 0x306,
+ NT_S390_SYSTEM_CALL = 0x307,
+ NT_S390_TDB = 0x308,
+ NT_S390_VXRS_LOW = 0x309,
+ NT_S390_VXRS_HIGH = 0x30a,
+ NT_S390_GS_CB = 0x30b,
+ NT_S390_GS_BC = 0x30c,
+
+ NT_ARM_VFP = 0x400,
+ NT_ARM_TLS = 0x401,
+ NT_ARM_HW_BREAK = 0x402,
+ NT_ARM_HW_WATCH = 0x403,
+ NT_ARM_SVE = 0x405,
+ NT_ARM_PAC_MASK = 0x406,
+
+ NT_FILE = 0x46494c45,
+ NT_PRXFPREG = 0x46e62b7f,
+ NT_SIGINFO = 0x53494749,
+};
+
+// GNU note types
enum {
NT_GNU_ABI_TAG = 1,
NT_GNU_HWCAP = 2,
return "";
}
+static StringRef getCoreNoteTypeName(const uint32_t NT) {
+ static const struct {
+ uint32_t ID;
+ const char *Name;
+ } Notes[] = {
+ {ELF::NT_PRSTATUS, "NT_PRSTATUS (prstatus structure)"},
+ {ELF::NT_FPREGSET, "NT_FPREGSET (floating point registers)"},
+ {ELF::NT_PRPSINFO, "NT_PRPSINFO (prpsinfo structure)"},
+ {ELF::NT_TASKSTRUCT, "NT_TASKSTRUCT (task structure)"},
+ {ELF::NT_AUXV, "NT_AUXV (auxiliary vector)"},
+ {ELF::NT_PSTATUS, "NT_PSTATUS (pstatus structure)"},
+ {ELF::NT_FPREGS, "NT_FPREGS (floating point registers)"},
+ {ELF::NT_PSINFO, "NT_PSINFO (psinfo structure)"},
+ {ELF::NT_LWPSTATUS, "NT_LWPSTATUS (lwpstatus_t structure)"},
+ {ELF::NT_LWPSINFO, "NT_LWPSINFO (lwpsinfo_t structure)"},
+ {ELF::NT_WIN32PSTATUS, "NT_WIN32PSTATUS (win32_pstatus structure)"},
+
+ {ELF::NT_PPC_VMX, "NT_PPC_VMX (ppc Altivec registers)"},
+ {ELF::NT_PPC_VSX, "NT_PPC_VSX (ppc VSX registers)"},
+ {ELF::NT_PPC_TAR, "NT_PPC_TAR (ppc TAR register)"},
+ {ELF::NT_PPC_PPR, "NT_PPC_PPR (ppc PPR register)"},
+ {ELF::NT_PPC_DSCR, "NT_PPC_DSCR (ppc DSCR register)"},
+ {ELF::NT_PPC_EBB, "NT_PPC_EBB (ppc EBB registers)"},
+ {ELF::NT_PPC_PMU, "NT_PPC_PMU (ppc PMU registers)"},
+ {ELF::NT_PPC_TM_CGPR, "NT_PPC_TM_CGPR (ppc checkpointed GPR registers)"},
+ {ELF::NT_PPC_TM_CFPR,
+ "NT_PPC_TM_CFPR (ppc checkpointed floating point registers)"},
+ {ELF::NT_PPC_TM_CVMX,
+ "NT_PPC_TM_CVMX (ppc checkpointed Altivec registers)"},
+ {ELF::NT_PPC_TM_CVSX, "NT_PPC_TM_CVSX (ppc checkpointed VSX registers)"},
+ {ELF::NT_PPC_TM_SPR, "NT_PPC_TM_SPR (ppc TM special purpose registers)"},
+ {ELF::NT_PPC_TM_CTAR, "NT_PPC_TM_CTAR (ppc checkpointed TAR register)"},
+ {ELF::NT_PPC_TM_CPPR, "NT_PPC_TM_CPPR (ppc checkpointed PPR register)"},
+ {ELF::NT_PPC_TM_CDSCR,
+ "NT_PPC_TM_CDSCR (ppc checkpointed DSCR register)"},
+
+ {ELF::NT_386_TLS, "NT_386_TLS (x86 TLS information)"},
+ {ELF::NT_386_IOPERM, "NT_386_IOPERM (x86 I/O permissions)"},
+ {ELF::NT_X86_XSTATE, "NT_X86_XSTATE (x86 XSAVE extended state)"},
+
+ {ELF::NT_S390_HIGH_GPRS,
+ "NT_S390_HIGH_GPRS (s390 upper register halves)"},
+ {ELF::NT_S390_TIMER, "NT_S390_TIMER (s390 timer register)"},
+ {ELF::NT_S390_TODCMP, "NT_S390_TODCMP (s390 TOD comparator register)"},
+ {ELF::NT_S390_TODPREG,
+ "NT_S390_TODPREG (s390 TOD programmable register)"},
+ {ELF::NT_S390_CTRS, "NT_S390_CTRS (s390 control registers)"},
+ {ELF::NT_S390_PREFIX, "NT_S390_PREFIX (s390 prefix register)"},
+ {ELF::NT_S390_LAST_BREAK,
+ "NT_S390_LAST_BREAK (s390 last breaking event address)"},
+ {ELF::NT_S390_SYSTEM_CALL,
+ "NT_S390_SYSTEM_CALL (s390 system call restart data)"},
+ {ELF::NT_S390_TDB, "NT_S390_TDB (s390 transaction diagnostic block)"},
+ {ELF::NT_S390_VXRS_LOW,
+ "NT_S390_VXRS_LOW (s390 vector registers 0-15 upper half)"},
+ {ELF::NT_S390_VXRS_HIGH,
+ "NT_S390_VXRS_HIGH (s390 vector registers 16-31)"},
+ {ELF::NT_S390_GS_CB, "NT_S390_GS_CB (s390 guarded-storage registers)"},
+ {ELF::NT_S390_GS_BC,
+ "NT_S390_GS_BC (s390 guarded-storage broadcast control)"},
+
+ {ELF::NT_ARM_VFP, "NT_ARM_VFP (arm VFP registers)"},
+ {ELF::NT_ARM_TLS, "NT_ARM_TLS (AArch TLS registers)"},
+ {ELF::NT_ARM_HW_BREAK,
+ "NT_ARM_HW_BREAK (AArch hardware breakpoint registers)"},
+ {ELF::NT_ARM_HW_WATCH,
+ "NT_ARM_HW_WATCH (AArch hardware watchpoint registers)"},
+
+ {ELF::NT_FILE, "NT_FILE (mapped files)"},
+ {ELF::NT_PRXFPREG, "NT_PRXFPREG (user_xfpregs structure)"},
+ {ELF::NT_SIGINFO, "NT_SIGINFO (siginfo_t data)"},
+ };
+
+ for (const auto &Note : Notes)
+ if (Note.ID == NT)
+ return Note.Name;
+
+ return "";
+}
+
static std::string getGNUNoteTypeName(const uint32_t NT) {
static const struct {
uint32_t ID;
if (!N.Type.empty())
OS << " " << N.Type << ":\n " << N.Value << '\n';
} else {
- StringRef NoteType = getGenericNoteTypeName(Type);
+ StringRef NoteType = Obj->getHeader()->e_type == ELF::ET_CORE
+ ? getCoreNoteTypeName(Type)
+ : getGenericNoteTypeName(Type);
if (!NoteType.empty())
OS << NoteType;
else
if (!N.Type.empty())
W.printString(N.Type, N.Value);
} else {
- StringRef NoteType = getGenericNoteTypeName(Type);
+ StringRef NoteType = Obj->getHeader()->e_type == ELF::ET_CORE
+ ? getCoreNoteTypeName(Type)
+ : getGenericNoteTypeName(Type);
if (!NoteType.empty())
W.printString("Type", NoteType);
else