This change adds support for the R_ARM_SBREL32 relocation. The relocation is a base relative relocation that is produced by clang/llvm when -frwpi is used. The use case for the -frwpi option is position independent data for embedded systems that do not have a GOT. With -frwpi all read-write data is accessed via an offset from a base register (usually r9), where r9 is set at run time to where the RW data has been loaded. The base of the RW data is known as the static base.
Resolving the relocation is simple it is (S + A) - B where B is the static base. Choosing the location of and obtaining the value of the static base is more complicated. For lld I have chosen to use the base of the program segment containing the RW to be the static base. This supports the most common use case where there is a single PT_LOAD segment for the data.
Addresses PR32924 https://bugs.llvm.org/show_bug.cgi?id=32924