summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2006-04-05 01:35:26 +0000
committerRoland McGrath <[email protected]>2006-04-05 01:35:26 +0000
commitb43797284f61e63e0521e1c7263eb379bdd26995 (patch)
tree2679c517b30963d0b99b327dd0d5f4b2f8ed7e78
parent8bf747a4216b8fa84b1681dc45ff527e406ae64c (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.
-rw-r--r--libelf/ChangeLog4
-rw-r--r--libelf/elf32_updatefile.c8
-rw-r--r--tests/ChangeLog7
-rw-r--r--tests/Makefile.am3
-rwxr-xr-xtests/run-bug1-test.sh8
-rw-r--r--tests/testfile29.bz2bin0 -> 164 bytes
-rw-r--r--tests/testfile29.rdwr.bz2bin0 -> 164 bytes
7 files changed, 26 insertions, 4 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index c69b3d39..46083253 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-04 Roland McGrath <[email protected]>
+
+ * elf32_updatefile.c (updatemmap): Handle other-endian case.
+
2006-04-04 Ulrich Drepper <[email protected]>
* elf32_updatefile.c (updatemmap): Cleanups. Remove shdr_dest
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;
}
}
}
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 16b1491c..cbb4ac7e 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2006-04-04 Ulrich Drepper <[email protected]>
* Makefile.am: Add rules to run run-bug1-test.sh.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d53614c7..0ceef1b9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -112,7 +112,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
testfile26.bz2 testfile27.bz2 \
coverage.sh test-subr.sh test-wrapper.sh run-readelf-test1.sh \
- run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2
+ run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
+ testfile29.bz2 testfile29.rdwr.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
diff --git a/tests/run-bug1-test.sh b/tests/run-bug1-test.sh
index 2682d00a..7367a4ed 100755
--- a/tests/run-bug1-test.sh
+++ b/tests/run-bug1-test.sh
@@ -31,4 +31,12 @@ testrun ./rdwrmmap testfile28
cmp testfile28 testfile28.rdwr
+test_cleanup
+
+testfiles testfile29 testfile29.rdwr
+
+testrun ./rdwrmmap testfile29
+
+cmp testfile29 testfile29.rdwr
+
exit 0
diff --git a/tests/testfile29.bz2 b/tests/testfile29.bz2
new file mode 100644
index 00000000..b46451bf
--- /dev/null
+++ b/tests/testfile29.bz2
Binary files differ
diff --git a/tests/testfile29.rdwr.bz2 b/tests/testfile29.rdwr.bz2
new file mode 100644
index 00000000..42eadc70
--- /dev/null
+++ b/tests/testfile29.rdwr.bz2
Binary files differ