[all-commits] [llvm/llvm-project] 2212e9: [ELF, LTO] Test calloc defined in a lazy bitcode fi...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Nov 29 07:39:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2212e900599bb98a46b99b61ccc1983cdaf422d1
      https://github.com/llvm/llvm-project/commit/2212e900599bb98a46b99b61ccc1983cdaf422d1
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-11-29 (Wed, 29 Nov 2023)

  Changed paths:
    A lld/test/ELF/lto/libcall-archive-calloc.ll

  Log Message:
  -----------
  [ELF,LTO] Test calloc defined in a lazy bitcode file for (malloc+memset => calloc) libcall optimization

Similar to https://reviews.llvm.org/D50017: malloc+memset references can
be combined to a calloc reference, which is not explicit in the
referencer's IR symbol table. If calloc is defined in a lazy bitcode
file, we should extract the archive member to satisfy possible
references from LTO generated object files; otherwise (current status,
which will be fixed by #72673), `calloc` as a LazyObject symbol will be
resolved by compileBitcodeFiles generated Undefined, leading to an
incorrectly-extracted Defined symbol without section, which will lower
to an SHN_ABS symbol at address 0.




More information about the All-commits mailing list