[all-commits] [llvm/llvm-project] 291f4a: [Driver] -rdynamic: remove duplicate -export-dynamic

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Nov 15 21:24:26 PST 2023


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

  Changed paths:
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/test/Driver/dynamic-linker.c

  Log Message:
  -----------
  [Driver] -rdynamic: remove duplicate -export-dynamic

-export-dynamic is specified twice when -static is not specified. Fix
it.

While here, make some simplification, which can match GCC behavior as a
side benefit: suppress -export-dynamic for -static-pie/-shared. (GCC
passes -export-dynamic when -r is specified. This is unimportant
trivia).

This change largely has no behavior difference, since GNU ld and gold
ignore -export-dynamic when creating a statically linked executable or a
shared object.




More information about the All-commits mailing list