Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F169387380
D7390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7390.diff
View Options
Index: head/contrib/elftoolchain/readelf/readelf.c
===================================================================
--- head/contrib/elftoolchain/readelf/readelf.c
+++ head/contrib/elftoolchain/readelf/readelf.c
@@ -343,7 +343,7 @@
static const char *note_type_unknown(unsigned int nt);
static const char *note_type_xen(unsigned int nt);
static const char *option_kind(uint8_t kind);
-static const char *phdr_type(unsigned int ptype);
+static const char *phdr_type(unsigned int mach, unsigned int ptype);
static const char *ppc_abi_fp(uint64_t fp);
static const char *ppc_abi_vector(uint64_t vec);
static void readelf_usage(int status);
@@ -622,10 +622,24 @@
}
static const char *
-phdr_type(unsigned int ptype)
+phdr_type(unsigned int mach, unsigned int ptype)
{
static char s_ptype[32];
+ if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) {
+ switch (mach) {
+ case EM_ARM:
+ switch (ptype) {
+ case PT_ARM_ARCHEXT: return "ARM_ARCHEXT";
+ case PT_ARM_EXIDX: return "ARM_EXIDX";
+ }
+ break;
+ }
+ snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x",
+ ptype - PT_LOPROC);
+ return (s_ptype);
+ }
+
switch (ptype) {
case PT_NULL: return "NULL";
case PT_LOAD: return "LOAD";
@@ -639,10 +653,7 @@
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_RELRO: return "GNU_RELRO";
default:
- if (ptype >= PT_LOPROC && ptype <= PT_HIPROC)
- snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x",
- ptype - PT_LOPROC);
- else if (ptype >= PT_LOOS && ptype <= PT_HIOS)
+ if (ptype >= PT_LOOS && ptype <= PT_HIOS)
snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x",
ptype - PT_LOOS);
else
@@ -659,6 +670,15 @@
if (stype >= SHT_LOPROC && stype <= SHT_HIPROC) {
switch (mach) {
+ case EM_ARM:
+ switch (stype) {
+ case SHT_ARM_EXIDX: return "ARM_EXIDX";
+ case SHT_ARM_PREEMPTMAP: return "ARM_PREEMPTMAP";
+ case SHT_ARM_ATTRIBUTES: return "ARM_ATTRIBUTES";
+ case SHT_ARM_DEBUGOVERLAY: return "ARM_DEBUGOVERLAY";
+ case SHT_ARM_OVERLAYSECTION: return "ARM_OVERLAYSECTION";
+ }
+ break;
case EM_X86_64:
switch (stype) {
case SHT_X86_64_UNWIND: return "X86_64_UNWIND";
@@ -2273,9 +2293,10 @@
#define PH_HDR "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz", \
"MemSiz", "Flg", "Align"
-#define PH_CT phdr_type(phdr.p_type), (uintmax_t)phdr.p_offset, \
- (uintmax_t)phdr.p_vaddr, (uintmax_t)phdr.p_paddr, \
- (uintmax_t)phdr.p_filesz, (uintmax_t)phdr.p_memsz, \
+#define PH_CT phdr_type(re->ehdr.e_machine, phdr.p_type), \
+ (uintmax_t)phdr.p_offset, (uintmax_t)phdr.p_vaddr, \
+ (uintmax_t)phdr.p_paddr, (uintmax_t)phdr.p_filesz, \
+ (uintmax_t)phdr.p_memsz, \
phdr.p_flags & PF_R ? 'R' : ' ', \
phdr.p_flags & PF_W ? 'W' : ' ', \
phdr.p_flags & PF_X ? 'E' : ' ', \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 2, 9:40 AM (14 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37940824
Default Alt Text
D7390.diff (2 KB)
Attached To
Mode
D7390: readelf: report ARM program and section header types
Attached
Detach File
Event Timeline
Log In to Comment