diff options
| author | Roland McGrath <[email protected]> | 2006-04-05 01:35:26 +0000 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2006-04-05 01:35:26 +0000 |
| commit | b43797284f61e63e0521e1c7263eb379bdd26995 (patch) | |
| tree | 2679c517b30963d0b99b327dd0d5f4b2f8ed7e78 /libelf/elf32_updatefile.c | |
| parent | 8bf747a4216b8fa84b1681dc45ff527e406ae64c (diff) | |
libelf/
2006-04-04 Roland McGrath <[email protected]>
* elf32_updatefile.c (updatemmap): Handle other-endian case.
tests/
2006-04-04 Roland McGrath <[email protected]>
* run-bug1-test.sh: Test a second case, to cover both byte orders.
* testfile29.bz2: New file.
* testfile29.rdwr.bz2: New file.
* Makefile.am (EXTRA_DIST): Add them.
Diffstat (limited to 'libelf/elf32_updatefile.c')
| -rw-r--r-- | libelf/elf32_updatefile.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c index 5fa2ae71..59973503 100644 --- a/libelf/elf32_updatefile.c +++ b/libelf/elf32_updatefile.c @@ -224,7 +224,8 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) { Elf_Scn *scn = scns[cnt]; - if ((scn->shdr_flags & ELF_F_MALLOCED) == 0 + if (!elf->state.ELFW(elf,LIBELFBITS).shdr_malloced + && (scn->shdr_flags & ELF_F_MALLOCED) == 0 && scn->shdr.ELFW(e,LIBELFBITS) != &shdr_dest[scn->index]) { assert ((char *) elf->map_address + elf->start_offset @@ -348,10 +349,11 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) /* If we previously made a copy of the section header entry we now have to adjust the pointer again so point to new place in the mapping. */ - if ((scn->shdr_flags & ELF_F_MALLOCED) == 0) + if (!elf->state.ELFW(elf,LIBELFBITS).shdr_malloced + && (scn->shdr_flags & ELF_F_MALLOCED) == 0) scn->shdr.ELFW(e,LIBELFBITS) = &shdr_dest[scn->index]; - scn->shdr_flags &= ~ELF_F_DIRTY; + scn->shdr_flags &= ~ELF_F_DIRTY; } } } |
