Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145930903
D35194.id105940.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
D35194.id105940.diff
View Options
Index: usr.bin/gcore/elfcore.c
===================================================================
--- usr.bin/gcore/elfcore.c
+++ usr.bin/gcore/elfcore.c
@@ -234,7 +234,7 @@
/* Put notes. */
elf_putnotes(pid, sb, ¬esz);
/* Align up to a page boundary for the program segments. */
- sbuf_end_section(sb, -1, PAGE_SIZE, 0);
+ sbuf_end_section(sb, -1, getpagesize(), 0);
if (sbuf_finish(sb) != 0)
err(1, "sbuf_finish");
hdr = sbuf_data(sb);
@@ -295,15 +295,17 @@
{
struct phdr_closure *phc = (struct phdr_closure *)closure;
Elf_Phdr *phdr = phc->phdr;
+ size_t page_size;
- phc->offset = round_page(phc->offset);
+ page_size = getpagesize();
+ phc->offset = roundup2(phc->offset, page_size);
phdr->p_type = PT_LOAD;
phdr->p_offset = phc->offset;
phdr->p_vaddr = entry->start;
phdr->p_paddr = 0;
phdr->p_filesz = phdr->p_memsz = entry->end - entry->start;
- phdr->p_align = PAGE_SIZE;
+ phdr->p_align = page_size;
phdr->p_flags = 0;
if (entry->protection & VM_PROT_READ)
phdr->p_flags |= PF_R;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 27, 6:59 AM (13 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29019817
Default Alt Text
D35194.id105940.diff (1 KB)
Attached To
Mode
D35194: Use getpagesize in gcore to find the page size
Attached
Detach File
Event Timeline
Log In to Comment