Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109422028
D43123.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43123.diff
View Options
diff --git a/usr.sbin/kldxref/ef.h b/usr.sbin/kldxref/ef.h
--- a/usr.sbin/kldxref/ef.h
+++ b/usr.sbin/kldxref/ef.h
@@ -100,6 +100,7 @@
int ef_fd;
};
+#define elf_machine(ef) ((ef)->ef_hdr.e_machine)
#define elf_class(ef) ((ef)->ef_hdr.e_ident[EI_CLASS])
#define elf_encoding(ef) ((ef)->ef_hdr.e_ident[EI_DATA])
diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c
--- a/usr.sbin/kldxref/ef.c
+++ b/usr.sbin/kldxref/ef.c
@@ -248,8 +248,17 @@
dynamic_idx = -1;
for (i = 0; i < nshdr; i++) {
if (shdr[i].sh_type == SHT_DYNAMIC) {
+ /*
+ * PowerPC kernels contain additional sections
+ * beyond .dynamic in PT_DYNAMIC due to a linker
+ * script bug. Permit a section with a smaller
+ * size as a workaround.
+ */
if (shdr[i].sh_offset != phdyn->p_offset ||
- shdr[i].sh_size != phdyn->p_filesz) {
+ ((elf_machine(ef->ef_efile) == EM_PPC ||
+ elf_machine(ef->ef_efile) == EM_PPC64) ?
+ shdr[i].sh_size > phdyn->p_filesz :
+ shdr[i].sh_size != phdyn->p_filesz)) {
warnx(".dynamic section doesn't match phdr");
error = EFTYPE;
goto out;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 8:51 PM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16480649
Default Alt Text
D43123.diff (1 KB)
Attached To
Mode
D43123: kldxref: Workaround incorrect PT_DYNAMIC in existing powerpc kernels
Attached
Detach File
Event Timeline
Log In to Comment