search for: p_offset

Displaying 20 results from an estimated 46 matches for "p_offset".

Did you mean: v_offset
2011 May 29
22
[Bug 8177] New: Problems with big sparsed files
https://bugzilla.samba.org/show_bug.cgi?id=8177 Summary: Problems with big sparsed files Product: rsync Version: 3.0.8 Platform: x64 OS/Version: Linux Status: NEW Severity: normal Priority: P5 Component: core AssignedTo: wayned at samba.org ReportedBy: joluinfante at gmail.com
2020 Aug 13
2
Adding sections in a binary
...SHF_ALLOC section is simple. A non-SHF_ALLOC section is not part of the memory image and not used by the program (unless for some rare introspection use cases) * adding a SHF_ALLOC section is difficult. You likely need to fix the containing PT_LOAD segment. llvm-objcopy only does the base p_offset fix. You need to take care p_vaddr/p_paddr/p_filesz/p_memsz by your self. + adding a section smaller than the known lowest address (ET_EXEC with a non-zero image base) or larger than the known largest address: The PT_LOAD fixes are doable. + adding a section within the existing...
2002 Aug 05
5
[patch] read-devices
...residue); } mdfour_result(&md, (uchar *)sum); Only in rsync-patched: config.h diff -r -u4 rsync-2.5.5/fileio.c rsync-patched/fileio.c --- rsync-2.5.5/fileio.c Sat Jan 26 02:07:34 2002 +++ rsync-patched/fileio.c Mon Aug 5 10:05:15 2002 @@ -111,32 +111,43 @@ map->p_size = 0; map->p_offset = 0; map->p_fd_offset = 0; map->p_len = 0; + map->m_ptr = NULL; + map->m_len = 0; return map; } -/* slide the read window in the file */ -char *map_ptr(struct map_struct *map,OFF_T offset,int len) +/* slide the read window in the file. + * The state of the window is saved in...
2009 Apr 26
4
DO NOT REPLY [Bug 6293] New: rsync crashes when transferring files
...---- After the last message I receive an alert from the MacOSX crash reporter about a access violation. I made the kernel dump it core and got the following backtrace: -----8<----- #0 0x0003123b in map_ptr (map=0x0, offset=0, len=32768) at fileio.c:192 192 if (offset >= map->p_offset && offset+len <= map->p_offset+map->p_len) (gdb) bt #0 0x0003123b in map_ptr (map=0x0, offset=0, len=32768) at fileio.c:192 #1 0x00011e54 in receive_data (f_in=5, fname_r=0x0, fd_r=-1, size_r=0, fname=0x0, fd=-1, total_size=50263) at receiver.c:202 #2 0x00012271 in discard_recei...
2020 Aug 13
2
Adding sections in a binary
Hey, LLVM has logic to parse ELF and PE binaries using `llvm::object::createBinary`. I tried to search in the codebase to see if there's a possibility to add/remove sections after parsing a binary and re-write the binary to another location. Basically, like what llvm-objcopy does. Can you point me to the right classes to look into, if this is something that LLVM has? Many thanks Joseph
2019 Sep 03
2
[RFC] Moving RELRO segment
...RW ; the two R cannot be > merged > > | means a maxpagesize alignment. I am not sure whether you are going to > add it > because I still do not understand where the saving comes from. > > If the alignment is added, the R and RW maps can get contiguous > (non-overlapping) p_offset ranges. However, the RW map is private dirty, > it cannot be merged with adjacent maps so I am not clear how it can save > kernel memory. > My understanding (and my test result shows so) is that two VMAs can be merged even when one of them contains dirty pages. As far as I can tell from r...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...# e_phentsize + .word (e_phdr - phdr)/(e_phdr1 - phdr) # e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp $BOOTSEG, $start2 + + .org 80 +phdr: + .int PT_LOAD # p_type + .int _text # p_offset + .int 0x8000 # p_vaddr + .int 0x8000 # p_paddr + .int _filesz # p_filesz + .int _memsz # p_memsz + .int PF_R | PF_W | PF_X # p_flags + .int 4 # p_align +e_phdr1: + .int PT_LOAD # p_type + .int kernel - bootsect_start # p_offset + .int LOAD_PHYSICAL_ADDR # p_vaddr +...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...# e_phentsize + .word (e_phdr - phdr)/(e_phdr1 - phdr) # e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp $BOOTSEG, $start2 + + .org 80 +phdr: + .int PT_LOAD # p_type + .int _text # p_offset + .int 0x8000 # p_vaddr + .int 0x8000 # p_paddr + .int _filesz # p_filesz + .int _memsz # p_memsz + .int PF_R | PF_W | PF_X # p_flags + .int 4 # p_align +e_phdr1: + .int PT_LOAD # p_type + .int kernel - bootsect_start # p_offset + .int LOAD_PHYSICAL_ADDR # p_vaddr +...
2019 Aug 29
2
[RFC] Moving RELRO segment
On Thu, Aug 29, 2019 at 3:10 AM Fāng-ruì Sòng <maskray at google.com> wrote: > Hello Vic, > > To make sure I understand the proposal correctly, do you propose: > > Old: R RX RW(RELRO) RW > New: R(R+RELRO) RX RW; R includes the traditional R part and the > RELRO part > Runtime (before relocation resolving): RW RX RW > Runtime (after relocation resolving): R RX
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap, uch *input_data, unsigned long input_len, uch *output) @@ -408,6 +463,7 @@ asmlinkage void decompress_kernel(void *rmode, me...
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap, uch *input_data, unsigned long input_len, uch *output) @@ -408,6 +463,7 @@ asmlinkage void decompress_kernel(void *rmode, me...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...p_paddr); + i, phdr[i].p_memsz, (void *)(long)phdr[i].p_paddr); /* We map everything private, writable. */ if (phdr[i].p_paddr + phdr[i].p_memsz > mem) errx(1, "Segment %i overlaps end of memory", i); @@ -227,6 +244,77 @@ static u32 map_elf(int elf_fd, const Elf phdr[i].p_offset -= (phdr[i].p_paddr % getpagesize()); phdr[i].p_paddr -= (phdr[i].p_paddr % getpagesize()); } + addr = mmap((void *)(long)phdr[i].p_paddr, + phdr[i].p_filesz, + PROT_READ|PROT_WRITE|PROT_EXEC, + MAP_FIXED|MAP_PRIVATE, + elf_fd, phdr[i].p_offset); + if (addr != (void...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...p_paddr); + i, phdr[i].p_memsz, (void *)(long)phdr[i].p_paddr); /* We map everything private, writable. */ if (phdr[i].p_paddr + phdr[i].p_memsz > mem) errx(1, "Segment %i overlaps end of memory", i); @@ -227,6 +244,77 @@ static u32 map_elf(int elf_fd, const Elf phdr[i].p_offset -= (phdr[i].p_paddr % getpagesize()); phdr[i].p_paddr -= (phdr[i].p_paddr % getpagesize()); } + addr = mmap((void *)(long)phdr[i].p_paddr, + phdr[i].p_filesz, + PROT_READ|PROT_WRITE|PROT_EXEC, + MAP_FIXED|MAP_PRIVATE, + elf_fd, phdr[i].p_offset); + if (addr != (void...
2012 Jul 05
10
[PATCH] kexec-tools: Read always one vmcoreinfo file
...ranges * sizeof(PHDR); /* @@ -179,21 +175,6 @@ int FUNC(struct kexec_info *info, dbgprintf_phdr("vmcoreinfo header", phdr); } - if (has_vmcoreinfo_xen) { - phdr = (PHDR *) bufp; - bufp += sizeof(PHDR); - phdr->p_type = PT_NOTE; - phdr->p_flags = 0; - phdr->p_offset = phdr->p_paddr = vmcoreinfo_addr_xen; - phdr->p_vaddr = 0; - phdr->p_filesz = phdr->p_memsz = vmcoreinfo_len_xen; - /* Do we need any alignment of segments? */ - phdr->p_align = 0; - - (elf->e_phnum)++; - dbgprintf_phdr("vmcoreinfo_xen header", phdr); - } - /...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...;amap, addr, msize, SMT_ALLOC)) { + error("Overlapping segments found in ELF header\n"); + return NULL; + } + + if (ph64->p_filesz) { + /* Data present region. Create a move entry for it. */ + if (syslinux_add_movelist + (&ml, addr, (addr_t) cptr + ph64->p_offset, dsize)) { + error("Failed to map PHDR data\n"); + return NULL; + } + } + if (msize > dsize) { + /* Zero-filled region. Mark as a zero region in the memory map. */ + if (syslinux_add_memmap + (&mmap, addr + dsize, msize - dsize, SMT_ZERO)) { + error("...
2007 Jun 06
7
[PATCH RFC 0/7] proposed updates to boot protocol and paravirt booting
This series: 1. Updates the boot protocol to version 2.07 2. Clean up the existing build process, to get rid of tools/build and make the linker do more heavy lifting 3. Make the bzImage payload an ELF file. The bootloader can extract this as a naked ELF file by skipping over boot_params.setup_sects worth of 16-bit setup code. 4. Update the boot_params to 2.07, and update the
2007 Jun 06
7
[PATCH RFC 0/7] proposed updates to boot protocol and paravirt booting
This series: 1. Updates the boot protocol to version 2.07 2. Clean up the existing build process, to get rid of tools/build and make the linker do more heavy lifting 3. Make the bzImage payload an ELF file. The bootloader can extract this as a naked ELF file by skipping over boot_params.setup_sects worth of 16-bit setup code. 4. Update the boot_params to 2.07, and update the
2008 Mar 31
3
[PATCH 3/4] extract vmcoreinfo from /proc/vmcore for Xen
...s_vmcoreinfo_xen) * sizeof(PHDR) + ranges * sizeof(PHDR); /* @@ -168,6 +175,21 @@ dbgprintf_phdr("vmcoreinfo header", phdr); } + if (has_vmcoreinfo_xen) { + phdr = (PHDR *) bufp; + bufp += sizeof(PHDR); + phdr->p_type = PT_NOTE; + phdr->p_flags = 0; + phdr->p_offset = phdr->p_paddr = vmcoreinfo_addr_xen; + phdr->p_vaddr = 0; + phdr->p_filesz = phdr->p_memsz = vmcoreinfo_len_xen; + /* Do we need any alignment of segments? */ + phdr->p_align = 0; + + (elf->e_phnum)++; + dbgprintf_phdr("vmcoreinfo_xen header", phdr); + } + /...
2008 Jan 31
0
[PATCH] x86: use ELF format in compressed images.
...quot;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: + memcpy((void*)phdr->p_paddr, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap, uch *input_data, unsigned long input_len, uch *output) @@ -408,6 +456,7 @@ asmlinkage void decompress_kernel(void *rmode, me...
2008 Jan 31
0
[PATCH] x86: use ELF format in compressed images.
...quot;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: + memcpy((void*)phdr->p_paddr, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap, uch *input_data, unsigned long input_len, uch *output) @@ -408,6 +456,7 @@ asmlinkage void decompress_kernel(void *rmode, me...