[PATCH] D36823: [LLD][ELF] Read ARM BuildAttributes section to determine supported features.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 03:50:33 PDT 2017


peter.smith created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

lld assumes some ARM features that are not available in all Arm processors. In particular:

- The blx instruction present for interworking.
- The movt/movw instructions are used in Thunks.
- The https://reviews.llvm.org/J1=1 https://reviews.llvm.org/J2=1 encoding of branch immediates to improve Thumb wide branch range are assumed to be present.

This patch reads the ARM Attributes section to check for the architecture the object file was compiled with. If none of the objects have an architecture that supports these features a warning will be given. These warnings are most likely to affect people compiling for Armv6 as used in the first Raspberry Pi as this is the only mass-market device capable of running linux or BSD that isn't Armv7 or higher.

For completeness I would like to implement support for Armv6 by providing alternative implementations that don't use these features. These can come in later patches.


https://reviews.llvm.org/D36823

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/InputFiles.cpp
  test/ELF/arm-bl-v6.s
  test/ELF/arm-blx-v4t.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36823.111489.patch
Type: text/x-patch
Size: 8283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170817/92842404/attachment.bin>


More information about the llvm-commits mailing list