[all-commits] [llvm/llvm-project] 3238b0: [LLD][ELF][ARM] clang-format function signature [NFC]

Peter Smith via All-commits all-commits at lists.llvm.org
Tue Jan 28 03:54:46 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3238b03c197741207dea8cc3bc3273f74b448460
      https://github.com/llvm/llvm-project/commit/3238b03c197741207dea8cc3bc3273f74b448460
  Author: Peter Smith <peter.smith at linaro.org>
  Date:   2020-01-28 (Tue, 28 Jan 2020)

  Changed paths:
    M lld/ELF/Arch/ARM.cpp

  Log Message:
  -----------
  [LLD][ELF][ARM] clang-format function signature [NFC]

ARM::needsThunk had gone over 80 characters, run clang-format over it to
prevent it wrapping.


  Commit: 4f38ab250ff4680375c4c01db0a88c157093c665
      https://github.com/llvm/llvm-project/commit/4f38ab250ff4680375c4c01db0a88c157093c665
  Author: Peter Smith <peter.smith at linaro.org>
  Date:   2020-01-28 (Tue, 28 Jan 2020)

  Changed paths:
    M lld/ELF/Arch/ARM.cpp
    A lld/test/ELF/arm-thumb-interwork-ifunc.s
    A lld/test/ELF/arm-thumb-interwork-notfunc.s
    M lld/test/ELF/arm-thunk-edgecase.s

  Log Message:
  -----------
  [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols

ELF for the ARM architecture requires linkers to provide
interworking for symbols that are of type STT_FUNC. Interworking for
other symbols must be encoded directly in the object file. LLD was always
providing interworking, regardless of the symbol type, this breaks some
programs that have branches from Thumb state targeting STT_NOTYPE symbols
that have bit 0 clear, but they are in fact internal labels in a Thumb
function. LLD treats these symbols as ARM and inserts a transition to Arm.

This fixes the problem for in range branches, R_ARM_JUMP24,
R_ARM_THM_JUMP24 and R_ARM_THM_JUMP19. This is expected to be the vast
majority of problem cases as branching to an internal label close to the
function.

There is at least one follow up patch required.
- R_ARM_CALL and R_ARM_THM_CALL may do interworking via BL/BLX
  substitution.

In theory range-extension thunks can be altered to not change state when
the symbol type is not STT_FUNC. I will need to check with ld.bfd to see if
this is the case in practice.

Fixes (part of) https://github.com/ClangBuiltLinux/linux/issues/773

Differential Revision: https://reviews.llvm.org/D73474


Compare: https://github.com/llvm/llvm-project/compare/5c0516598436...4f38ab250ff4


More information about the All-commits mailing list