Created attachment 6908 [details]
See the run_dump_test test-case patch in the attachment. Note that the type-specifiers for the symbol types are commented out; the code is derived from mixed-lib.s but with function names swapped, calling arm from thumb and thumb from arm. The call from app_tfunc (in thumb mode) to lib_func2 (in arm mode) doesn't get a stub with "todays" sources. The expected test-case output is observed by adding back the type specifiers causing a proper thumb-to-arm stub being generated with the test passing.
The real-world code is somewhat sloppy hand-written assembly-code; no symbol decorations, just .global where necessary, but which worked with a toolchain using pre-2.19 binutils.
pretty sure this is Working As Intended and you need to fix your code:
(In reply to comment #1)
> pretty sure this is Working As Intended and you need to fix your code:
The Right Thing is to fix the code - but also to fix the linker.
Why? The current behavior is a change from 2.21 and is inconsistent with how global symbols are handled locally (in a single file) by the linker; see ld-arm/ fix-arm1176.s. The behavior is allowed but not guaranteed as per the AAELF. I have a patch so I better take the PR.
The patch is at <http://sourceware.org/ml/binutils/2013-03/msg00020.html> and the message upon closing this PR is at <http://sourceware.org/ml/binutils/2013-05/msg00088.html>.