Re: Elf64_Phdr

2019-06-27 Thread Mark Wielaard
m here is > that I need to assess with the updated headers where to place a new > header. It seems I can't call elf64_newphdr again on the new_elf > handle. Yes, if you want to shuffle the phdrs around and/or insert headers then you need to keep around copies of the original headers. You

Re: Elf64_Phdr

2019-06-27 Thread Mark Wielaard
On Tue, 2019-06-25 at 22:09 +, Sasha Da Rocha Pinheiro wrote: > > What happens if I call elf64_newphdr() on the same Elf * but with > different size_t __cnt? It creates a new phdr table for the Elf with cnt entries, whether or not the phdr table existed or not. If cnt is zero any existing

Re: Elf64_Phdr

2019-06-26 Thread Sasha Da Rocha Pinheiro
utils-devel@sourceware.org Subject: Re: Elf64_Phdr    What happens if I call elf64_newphdr() on the same Elf * but with different size_t __cnt?  What happens to the previous headers?      Sasha      From: Mark Wielaard  Sent: Tuesday, June 25, 2019 12:56:04 AM  To: Sasha Da Rocha Pinheir

Re: Elf64_Phdr

2019-06-25 Thread Sasha Da Rocha Pinheiro
Subject: Re: Elf64_Phdr   On Tue, 2019-06-25 at 05:22 +, Sasha Da Rocha Pinheiro wrote: >   Oh, of course, that might be it. >    >  Do you know if when it's open with write permission, changes will be > mapped back to the file? That depends on whether it is

Re: Elf64_Phdr

2019-06-24 Thread Mark Wielaard
On Tue, 2019-06-25 at 05:22 +, Sasha Da Rocha Pinheiro wrote: > Oh, of course, that might be it. > > Do you know if when it's open with write permission, changes will be > mapped back to the file? That depends on whether it is opened with mmap MAP_PRIVATE (ELF_C_READ_MMAP_PRIVATE,) or

Re: Elf64_Phdr

2019-06-24 Thread Sasha Da Rocha Pinheiro
Oh, of course, that might be it. Do you know if when it's open with write permission, changes will be mapped back to the file? Thanks, Sasha From: Frank Ch. Eigler Sent: Monday, June 24, 5:06 PM Subject: Re: Elf64_Phdr To: Sasha Da Rocha Pinheiro

Re: Elf64_Phdr

2019-06-24 Thread Frank Ch. Eigler
Hi - > If I have a Elf64_Phdr, why can't I straight change its elements, like, I'm > getting seg fault when trying to do: > (see gdb output) > > ... received signal SIGSEGV, Segmentation fault. > ... > 957 oldPhdr->p_vaddr = 0x1235; > (gdb) p/x oldPhdr

Elf64_Phdr

2019-06-24 Thread Sasha Da Rocha Pinheiro
Hi all, If I have a Elf64_Phdr, why can't I straight change its elements, like, I'm getting seg fault when trying to do: (see gdb output) ... received signal SIGSEGV, Segmentation fault. ... 957 oldPhdr->p_vaddr = 0x1235; (gdb) p/x oldPhdr $11 = 0x3ffb4bf0040 (gdb) p/x