[all-commits] [llvm/llvm-project] 1b3e37: [lld][ELF] --wrap: Make X weak when __real_X is to...

Alexander Qi via All-commits all-commits at lists.llvm.org
Wed Jul 10 18:39:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b3e376ec0a77f7d7d20d0d32047678dafa142ae
      https://github.com/llvm/llvm-project/commit/1b3e376ec0a77f7d7d20d0d32047678dafa142ae
  Author: Alexander Qi <xdqi at users.noreply.github.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M lld/ELF/Driver.cpp
    A lld/test/ELF/wrap-weak.s

  Log Message:
  -----------
  [lld][ELF] --wrap: Make X weak when __real_X is to avoid undefined symbol errors (#98297)

Fix #98294.

When you specify --wrap=foo, sometimes foo is undefined in any context.
If you declare __real_foo as weak, GNU ld will not attempt to find the
strong symbol foo, instead, it generates a weak undefined symbol.

This pull request imitates this behavior by copying the binding
attribute from __real_foo to foo.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list