llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.7k stars 10.94k forks source link

Support arm32 #49049

Open int3 opened 3 years ago

int3 commented 3 years ago
Bugzilla Link 49705
Version unspecified
OS All
CC @gkmhub,@int3,@smeenai

Extended Description

In particular, watchOS uses it

int3 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?)

int3 commented 3 years ago

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

int3 commented 3 years ago

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

int3 commented 3 years ago

Actually, watchOS uses arm64_32...