]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf/
authorRoland McGrath <roland@redhat.com>
Wed, 5 Apr 2006 01:35:26 +0000 (01:35 +0000)
committerRoland McGrath <roland@redhat.com>
Wed, 5 Apr 2006 01:35:26 +0000 (01:35 +0000)
2006-04-04  Roland McGrath  <roland@redhat.com>

* elf32_updatefile.c (updatemmap): Handle other-endian case.

tests/
2006-04-04  Roland McGrath  <roland@redhat.com>

* 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.

libelf/ChangeLog
libelf/elf32_updatefile.c
tests/ChangeLog
tests/Makefile.am
tests/run-bug1-test.sh
tests/testfile29.bz2 [new file with mode: 0644]
tests/testfile29.rdwr.bz2 [new file with mode: 0644]

index c69b3d392e33e05839c20650078bf7ce00322cd6..46083253cf74442022812a802380a37e71226483 100644 (file)
@@ -1,3 +1,7 @@
+2006-04-04  Roland McGrath  <roland@redhat.com>
+
+       * elf32_updatefile.c (updatemmap): Handle other-endian case.
+
 2006-04-04  Ulrich Drepper  <drepper@redhat.com>
 
        * elf32_updatefile.c (updatemmap): Cleanups.  Remove shdr_dest
index 5fa2ae71378641b3a0e0d981f1187e205ce7ef5c..59973503a3fc187081c5c0e75ae20ff43dde71ee 100644 (file)
@@ -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;
            }
        }
     }
index 16b1491c0353ed0b33ad56f4a747ee24c6df4978..cbb4ac7e21d50d11ac391f7acd7235b646fc967f 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-04  Roland McGrath  <roland@redhat.com>
+
+       * 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  <drepper@redhat.com>
 
        * Makefile.am: Add rules to run run-bug1-test.sh.
index d53614c730a93db1ee3e85fa6b12b70a5e2257b5..0ceef1b93e2e5650f707548d1c5937551aa28bcc 100644 (file)
@@ -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) \
index 2682d00aa1ba38afcce9b7cb57dba2a695b74533..7367a4ed54588d2eb1ac4c279f5b559a152b43ab 100755 (executable)
@@ -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 (file)
index 0000000..b46451b
Binary files /dev/null and b/tests/testfile29.bz2 differ
diff --git a/tests/testfile29.rdwr.bz2 b/tests/testfile29.rdwr.bz2
new file mode 100644 (file)
index 0000000..42eadc7
Binary files /dev/null and b/tests/testfile29.rdwr.bz2 differ