summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-06-19 14:22:33 +0000
committerPaul Brook <paul@codesourcery.com>2006-06-19 14:22:33 +0000
commit3d1690b199159f792e040e355243648d3e9333da (patch)
tree907e88b206d34bcac5516568f9d4db45b2b011ab
parent24796c7d3096c79e391f4136cc0feeab08ac8e5c (diff)
downloadgdb-3d1690b199159f792e040e355243648d3e9333da.tar.gz
2006-06-19 Vladimir Prus <vladimir@codesourcery.com>
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.
-rw-r--r--ChangeLog.csl11
-rw-r--r--bfd/elf32-arm.c13
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 173cfc5c0ae..54f22aacf8a 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,14 @@
+2006-06-19 Vladimir Prus <vladimir@codesourcery.com>
+
+ 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.
+
2006-06-15 Mark Shinwell <shinwell@codesourcery.com>
* include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2}
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 3c603840089..9768d8c88c8 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9155,6 +9155,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;