Bug 15217 - branch-to-arm-from-thumb for typeless symbol is missing a stub
Summary: branch-to-arm-from-thumb for typeless symbol is missing a stub
Status: RESOLVED WONTFIX
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Hans-Peter Nilsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 04:58 UTC by Hans-Peter Nilsson
Modified: 2013-05-07 21:13 UTC (History)
1 user (show)

See Also:
Host:
Target: arm-unknown-linux-gnueabi
Build:
Last reconfirmed:


Attachments
test-case (915 bytes, text/plain)
2013-03-01 04:58 UTC, Hans-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2013-03-01 04:58:15 UTC
Created attachment 6908 [details]
test-case

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.
Comment 1 Mike Frysinger 2013-03-03 05:06:52 UTC
pretty sure this is Working As Intended and you need to fix your code:
http://sourceware.org/ml/binutils/2012-03/msg00125.html
Comment 2 Hans-Peter Nilsson 2013-03-03 11:52:05 UTC
(In reply to comment #1)
> pretty sure this is Working As Intended and you need to fix your code:
> http://sourceware.org/ml/binutils/2012-03/msg00125.html

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.
Comment 3 Hans-Peter Nilsson 2013-05-07 21:13:59 UTC
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>.