opened
pdreiter
username_0
[43, 81, 0, 0, 52, **81**, 0, 0]
```

**Environment (please complete the following information):**
 - Ubuntu 19.04
 - Target format: ELF
 - LIEF commit version: 0.10.1-bfe5415

**Additional context**
Last entry in .data section content is not updated to new offset when segment is added
issue
created
romainthomas
username_1
I think I understand the issue but the modification seems not generic ? Also, did you check the relocations ?
comment
created
pdreiter
username_0
I did check the relocation sections, but I will check again.
Anything in particular you want me to report? 
 I will also update with more info about the problematic global symbol.

I’m rephrasing what I have seen in case my first attempt lacked clarity:
The global .data symbol whose addresses are partially converted is an 9 element array of const char*s. LIEF updated EPFD[7] to the new virtual address in .rodata, but EPFD[8] contains the unmodified offset.


Update: the test passed after manually updating .data’s EPFD[8] to the new virtual address.
comment
created
pdreiter
username_0
164
```
comment
created
pdreiter
username_0
I was able to generate a VERY simple scenario that duplicates this bug. 
Please note that I found this with **32b ELF** executables.

contents of test_418.c
```
#include <stdio.h>
//--------------------------------------------------------
// basic scenario to test out lief bug 418 filed by username_0
//--------------------------------------------------------

static char* words[] = {
"hello","my","baby",         // # 0-2
"hello","my","honey",      // # 3-5
"hello","my","ragtime","gal" // # 6-9
};


void main(){

for (int i=0;i<10;i++) {
   printf(words[i]);
   printf(" ");
}

}
```
COMPILE:
`gcc -m32 test_418.c -o lief_test_418`

lief manipulation:
```
import lief
x=lief.parse("lief_test_418")
x.add(lief.ELF.Segment())
x.write("lief_bug_418")
```
output of "./lief_test_418":
`hello my baby hello my honey hello my ragtime gal `
output of "./lief_bug_418"
`hello my baby hello my honey hello my ragtime  ` 

I cannot duplicate this error with a 64b ELF binary input: 
`gcc test_418.c -o lief64_test_418`
comment
created
pdreiter
username_0
@username_1 - I hope that this is good enough for you to root cause!
comment
closed
romainthomas
username_1
issue