Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151983225
D13926.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
D13926.diff
View Options
Index: head/stand/common/load_elf_obj.c
===================================================================
--- head/stand/common/load_elf_obj.c
+++ head/stand/common/load_elf_obj.c
@@ -224,6 +224,8 @@
#if defined(__i386__) || defined(__amd64__)
case SHT_X86_64_UNWIND:
#endif
+ if ((shdr[i].sh_flags & SHF_ALLOC) == 0)
+ break;
lastaddr = roundup(lastaddr, shdr[i].sh_addralign);
shdr[i].sh_addr = (Elf_Addr)lastaddr;
lastaddr += shdr[i].sh_size;
Index: head/sys/kern/link_elf_obj.c
===================================================================
--- head/sys/kern/link_elf_obj.c
+++ head/sys/kern/link_elf_obj.c
@@ -262,6 +262,9 @@
#ifdef __amd64__
case SHT_X86_64_UNWIND:
#endif
+ /* Ignore sections not loaded by the loader. */
+ if (shdr[i].sh_addr == 0)
+ break;
ef->nprogtab++;
break;
case SHT_SYMTAB:
@@ -335,6 +338,8 @@
#ifdef __amd64__
case SHT_X86_64_UNWIND:
#endif
+ if (shdr[i].sh_addr == 0)
+ break;
ef->progtab[pb].addr = (void *)shdr[i].sh_addr;
if (shdr[i].sh_type == SHT_PROGBITS)
ef->progtab[pb].name = "<<PROGBITS>>";
@@ -605,6 +610,8 @@
#ifdef __amd64__
case SHT_X86_64_UNWIND:
#endif
+ if ((shdr[i].sh_flags & SHF_ALLOC) == 0)
+ break;
ef->nprogtab++;
break;
case SHT_SYMTAB:
@@ -720,6 +727,8 @@
#ifdef __amd64__
case SHT_X86_64_UNWIND:
#endif
+ if ((shdr[i].sh_flags & SHF_ALLOC) == 0)
+ break;
alignmask = shdr[i].sh_addralign - 1;
mapsize += alignmask;
mapsize &= ~alignmask;
@@ -790,6 +799,8 @@
#ifdef __amd64__
case SHT_X86_64_UNWIND:
#endif
+ if ((shdr[i].sh_flags & SHF_ALLOC) == 0)
+ break;
alignmask = shdr[i].sh_addralign - 1;
mapbase += alignmask;
mapbase &= ~alignmask;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 10:28 PM (17 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31376290
Default Alt Text
D13926.diff (1 KB)
Attached To
Mode
D13926: Require the SHF_ALLOC flag for program sections from kernel object modules.
Attached
Detach File
Event Timeline
Log In to Comment