Alex Richardson fa210dd67b [Thumb] Baseline test for incorrect relocation with -ffunction-sections
When calling a dso_local function, we end up creating a call against the
.Lfoo$local label. This might be converted to a relocation against a
section if there is such a matching one (which is a lot more likely with
-ffunction-sections) and then the LSB (Thumb flag) will be lost.

I originally noticed this with Morello LLVM (which uses the LSB to indicate
a C64 encoding mode function). The missing LSB meant that ld.lld would
insert a thunk that switches encoding mode which then resulted in errors
at runtime since functions were being entered with the wrong encoding mode.
Since the Morello backend is not upstream, I looked if any in-tree
backends could also be affected by the missing STT_FUNC flag and noticed
that Thumb is also affected (although the bug is rather difficult to
trigger - it currently requires inline assembly).

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D131432
2022-08-09 09:53:47 +00:00
..
2021-07-07 10:21:07 +01:00
2021-07-01 21:08:13 +01:00
2020-06-18 17:26:24 +01:00
2020-12-08 11:54:39 +00:00
2020-04-09 10:36:00 +01:00
2021-03-17 15:29:02 +00:00
2019-12-12 13:51:39 +00:00
2021-11-21 18:33:29 +00:00
2020-01-21 10:40:17 +00:00
2020-12-08 11:54:39 +00:00
2020-07-16 11:25:53 +01:00
2020-10-07 11:47:03 +01:00
2020-12-08 11:54:39 +00:00