Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157246025
D6560.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D6560.id.diff
View Options
Index: readelf/readelf.c
===================================================================
--- readelf/readelf.c
+++ readelf/readelf.c
@@ -2757,6 +2757,8 @@
const char *symname;
uint64_t symval;
int i, len;
+ uint32_t type;
+ uint8_t type2, type3;
if (s->link >= re->shnum)
return;
@@ -2766,8 +2768,8 @@
elftc_reloc_type_str(re->ehdr.e_machine, \
ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname
#define REL_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \
- elftc_reloc_type_str(re->ehdr.e_machine, \
- ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname
+ elftc_reloc_type_str(re->ehdr.e_machine, type), \
+ (uintmax_t)symval, symname
printf("\nRelocation section (%s):\n", s->name);
if (re->ec == ELFCLASS32)
@@ -2793,12 +2795,35 @@
ELF64_R_TYPE(r.r_info));
printf("%8.8jx %8.8jx %-19.19s %8.8jx %s\n", REL_CT32);
} else {
+ type = ELF64_R_TYPE(r.r_info);
+ if (re->ehdr.e_machine == EM_MIPS) {
+ type2 = (type >> 8) & 0xFF;
+ type3 = (type >> 16) & 0xFF;
+ type = type & 0xFF;
+ }
if (re->options & RE_WW)
printf("%16.16jx %16.16jx %-24.24s"
" %16.16jx %s\n", REL_CT64);
else
printf("%12.12jx %12.12jx %-19.19s"
" %16.16jx %s\n", REL_CT64);
+ if (re->ehdr.e_machine == EM_MIPS) {
+ if (re->options & RE_WW) {
+ printf("%32s: %s\n", "Type2",
+ elftc_reloc_type_str(EM_MIPS,
+ type2));
+ printf("%32s: %s\n", "Type3",
+ elftc_reloc_type_str(EM_MIPS,
+ type3));
+ } else {
+ printf("%24s: %s\n", "Type2",
+ elftc_reloc_type_str(EM_MIPS,
+ type2));
+ printf("%24s: %s\n", "Type3",
+ elftc_reloc_type_str(EM_MIPS,
+ type3));
+ }
+ }
}
}
@@ -2813,6 +2838,8 @@
const char *symname;
uint64_t symval;
int i, len;
+ uint32_t type;
+ uint8_t type2, type3;
if (s->link >= re->shnum)
return;
@@ -2823,8 +2850,8 @@
elftc_reloc_type_str(re->ehdr.e_machine, \
ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname
#define RELA_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \
- elftc_reloc_type_str(re->ehdr.e_machine, \
- ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname
+ elftc_reloc_type_str(re->ehdr.e_machine, type), \
+ (uintmax_t)symval, symname
printf("\nRelocation section with addend (%s):\n", s->name);
if (re->ec == ELFCLASS32)
@@ -2851,6 +2878,12 @@
printf("%8.8jx %8.8jx %-19.19s %8.8jx %s", RELA_CT32);
printf(" + %x\n", (uint32_t) r.r_addend);
} else {
+ type = ELF64_R_TYPE(r.r_info);
+ if (re->ehdr.e_machine == EM_MIPS) {
+ type2 = (type >> 8) & 0xFF;
+ type3 = (type >> 16) & 0xFF;
+ type = type & 0xFF;
+ }
if (re->options & RE_WW)
printf("%16.16jx %16.16jx %-24.24s"
" %16.16jx %s", RELA_CT64);
@@ -2858,6 +2891,23 @@
printf("%12.12jx %12.12jx %-19.19s"
" %16.16jx %s", RELA_CT64);
printf(" + %jx\n", (uintmax_t) r.r_addend);
+ if (re->ehdr.e_machine == EM_MIPS) {
+ if (re->options & RE_WW) {
+ printf("%32s: %s\n", "Type2",
+ elftc_reloc_type_str(EM_MIPS,
+ type2));
+ printf("%32s: %s\n", "Type3",
+ elftc_reloc_type_str(EM_MIPS,
+ type3));
+ } else {
+ printf("%24s: %s\n", "Type2",
+ elftc_reloc_type_str(EM_MIPS,
+ type2));
+ printf("%24s: %s\n", "Type3",
+ elftc_reloc_type_str(EM_MIPS,
+ type3));
+ }
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 4:22 PM (8 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33351469
Default Alt Text
D6560.id.diff (3 KB)
Attached To
Mode
D6560: readelf: report all relocation types in rel/rela for MIPS N64
Attached
Detach File
Event Timeline
Log In to Comment