Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Support arm32 #48674

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR49705
Status NEW
Importance P enhancement
Reported by Jez Ng (jezreel@gmail.com)
Reported on 2021-03-23 17:13:49 -0700
Last modified on 2021-05-10 18:04:38 -0700
Version unspecified
Hardware PC All
CC gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

In particular, watchOS uses it

Quuxplusone commented 3 years ago

Actually, watchOS uses arm64_32...

Quuxplusone commented 3 years ago

Correction: Older Watch devices still use arm32, so we do want to support this.

Quuxplusone commented 3 years ago

De-prioritizing for now, we have decided to focus on other platforms first

Quuxplusone commented 3 years ago

@smeenai suggested that I document some of the potential issues with arm32 for whomever wants to try to add support, so here goes:

For branch targets with addends on arm32, llvm-mc will encode them using scattered relocations, which refer to their target using raw offsets (scattered relocs have no symbol number). However, we need to know what symbol the branch is pointing to, because the THUMB_DEF bit is stored on the symbol. Right now LLD only supports address -> subsection mappings, not address -> symbol. We can certainly add support for it, it's just a bunch more bookkeeping information, but it definitely feels a bit awkward, especially since we don't know whether our address offset has a a corresponding symbol, or if it's pointing into a section that has no symbols. (Maybe branch relocs will never target a section without symbols?)