2006-06-19 Vladimir Prus <vladimir@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Mon, 19 Jun 2006 14:22:27 +0000 (14:22 +0000)
committerPaul Brook <paul@codesourcery.com>
Mon, 19 Jun 2006 14:22:27 +0000 (14:22 +0000)
bfd/
* elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
bit for undefined symbols.

ld/testsuite
* ld-arm/arm-elf.exp: New test.
* ld-arm/use-thumb-lib.s: New file.
* ld-arm/use-thumb-lib.sym: New file.

bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp

index 5b1082245efbb53eee54c92d9a7b53f9161e0350..f9477033681314304d7fd1359b26ff6ef62c992b 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
+       bit for undefined symbols.
+
 2006-06-19  Alan Modra  <amodra@bigpond.net.au>
 
        * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer
index b360c934c282fe17da21cb351c6dfc875d6dd07a..bc7bcd1ceaac4867d78b72e1e0ca4ace5b57cb7f 100644 (file)
@@ -9172,6 +9172,19 @@ elf32_arm_swap_symbol_out (bfd *abfd,
     {
       newsym = *src;
       newsym.st_info = ELF_ST_INFO (ELF_ST_BIND (src->st_info), STT_FUNC);
+      if (newsym.st_shndx != SHN_UNDEF)
+        {
+          /* Do this only for defined symbols. At link type, the static
+             linker will simulate the work of dynamic linker of resolving
+             symbols and will carry over the thumbness of found symbols to
+             the output symbol table. It's not clear how it happens, but
+             the thumbness of underfined symbols can well be different at
+             runtime, and writing '1' for them will be confusing for users
+             and possibly for dynamic linker itself.
+          */
+          newsym.st_value |= 1;
+        }
+
       newsym.st_value |= 1;
       
       src = &newsym;
index 19c09c972163bf1abc8c5d49fdf1a45c12ed5ab5..667c03265e2eacac5c3d89f85bc89f01f7a9a2cb 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * ld-arm/arm-elf.exp: New test.
+       * ld-arm/use-thumb-lib.s: New file.
+       * ld-arm/use-thumb-lib.sym: New file.
+
 2006-06-15  Mark Shinwell  <shinwell@codesourcery.com>
 
        * ld-arm/group-relocs-alu-bad.d: New test.
index 09395069870607ec841ace35c6f00eb635506db5..e8e6a85246912f6422deacf1a44b6326aa87d646 100644 (file)
@@ -131,6 +131,10 @@ set armelftests {
     {"BE8 Mapping Symbols" "-static -T arm.ld -EB --be8" "-EB" {arm-be8.s}
      {{objdump -s arm-be8.d}}
      "arm-be8"}
+    {"Using Thumb lib by another lib" "-shared tmpdir/mixed-lib.so" "" {use-thumb-lib.s}
+     {{readelf -Ds use-thumb-lib.sym}}
+     "use-thumb-lib.so"}
+
 }
 
 run_ld_link_tests $armelftests
This page took 0.043876 seconds and 4 git commands to generate.