#!/bin/bash . $(dirname $0)/common.inc # Test that we don't get a spurious "duplicate symbol" error when an # LTO compilation produces a symbol that was previously only provided # by an archive member. After LTO, the archive member should be # recognized as no longer needed. # # This simulates the real-world case where the LTO backend emits # compiler-generated helpers (e.g. __udivsi3 on ARM) that also exist # in runtime libraries like libgcc. # # Regression test for https://github.com/rui314/mold/issues/1421 test_cflags -flto || skip # LTO object: defines asm_sym via inline asm (invisible to LTO plugin's # symbol table) and references it. The plugin sees asm_sym as undefined, # so the archive member below will be extracted to satisfy it. cat <