[all-commits] [llvm/llvm-project] f9b3c1: [CodeGen] Fix wrapping personality symbol on ARM

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Tue Sep 28 15:04:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9b3c18e74729b89d8ffa7351a4ed146526ce85a
      https://github.com/llvm/llvm-project/commit/f9b3c18e74729b89d8ffa7351a4ed146526ce85a
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    A lld/test/ELF/lto/arm-wrap-personality.ll
    M llvm/lib/CodeGen/AsmPrinter/ARMException.cpp

  Log Message:
  -----------
  [CodeGen] Fix wrapping personality symbol on ARM

The ARM backend was explicitly setting global binding on the personality
symbol. This was added without any comment in a7ec2dcefd954, which
introduced EHABI support (back in 2011). None of the other backends do
anything equivalent, as far as I can tell.

This causes problems when attempting to wrap the personality symbol.
Wrapped symbols are marked as weak inside LTO to inhibit IPO (see
https://reviews.llvm.org/D33621). When we wrap the personality symbol,
it initially gets weak binding, and then the ARM backend attempts to
change the binding to global, which causes an error in MC because of
attempting to change the binding of a symbol from non-global to global
(the error was added in https://reviews.llvm.org/D90108).

Simply drop the ARM backend's explicit global binding setting to fix
this. This matches all the other backends, and a large internal
application successfully linked and ran with this change, so it
shouldn't cause any problems. Test via LLD, since wrapping is required
to exhibit the issue.

Reviewed By: MaskRay

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




More information about the All-commits mailing list