[PATCH, ARM] Fix bl->blx conversion for object-local targets
Julian Brown
julian@codesourcery.com
Tue Nov 6 19:05:00 GMT 2012
More information about the Binutils mailing list
Tue Nov 6 19:05:00 GMT 2012
- Previous message (by thread): PR 14067 - addr2line broken on x86_64-w64-mingw32
- Next message (by thread): [PATCH, ARM] Fix bl->blx conversion for object-local targets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, Gas has logic which is supposed to turn Thumb BL instructions into BLX instructions when targeting local ARM symbols (and similarly for ARM BL instructions targeting local Thumb symbols). Unfortunately this is flawed at present, and can lead to incorrectly-encoded BLX instructions. The attached patch fixes this. The condition inside the #ifdef is moved lower down the function (otherwise the rounding-up of "value" to a word boundary never triggers after BL->BLX conversions), and the code which actually does the rounding is altered to match the comment -- I'm pretty sure in this case the comment was correct, but the code was only rounding up to a half-word boundary rather than a word boundary as stated. This bug manifested for me as a failure in GCC testing (g++.dg/ipa/pr46984.C in Thumb-1 mode), but only because that test happens to insert ARM-mode code (for a MI thunk) into Thumb output. I've added a new test, which passes with the patch, and fails without. No other regressions (gas tests), cross to ARM Linux. OK to apply? (Incidentally, an orthogonal problem might be that the ARM1176 erratum workaround described at: http://sourceware.org/ml/binutils/2011-07/msg00235.html is not taken into account when performing this kind of conversion. I'm not planning on tackling that issue though.) Thanks, Julian ChangeLog gas/ * config/tc-arm.c (md_apply_fix): Fix conversion of BL to BLX for local targets in Thumb mode. gas/testsuite/ * gas/arm/bl-local-2.s: New test. * gas/arm/bl-local-2.d: New. -------------- next part -------------- A non-text attachment was scrubbed... Name: thumb1-blx-local-fix-1.diff Type: text/x-patch Size: 2757 bytes Desc: not available URL: <https://sourceware.org/pipermail/binutils/attachments/20121106/c5ba9159/attachment.bin>
- Previous message (by thread): PR 14067 - addr2line broken on x86_64-w64-mingw32
- Next message (by thread): [PATCH, ARM] Fix bl->blx conversion for object-local targets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list