From: Paul Brook Date: Mon, 19 Jun 2006 14:22:27 +0000 (+0000) Subject: 2006-06-19 Vladimir Prus X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fa3dcad7e7c9674d050150a1e5c5d0f9454713f;p=binutils-gdb.git 2006-06-19 Vladimir Prus 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5b1082245ef..f9477033681 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2006-06-19 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low + bit for undefined symbols. + 2006-06-19 Alan Modra * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index b360c934c28..bc7bcd1ceaa 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -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; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 19c09c97216..667c03265e2 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-06-19 Vladimir Prus + + * 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 * ld-arm/group-relocs-alu-bad.d: New test. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 09395069870..e8e6a852469 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -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