Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Mar 2019 22:15:35 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 236141] LLD (unlike BFD) ignores unresolved references in libraries for indirect linking
Message-ID:  <bug-236141-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236141

            Bug ID: 236141
           Summary: LLD (unlike BFD) ignores unresolved references in
                    libraries for indirect linking
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: toolchain@FreeBSD.org
          Reporter: jbeich@FreeBSD.org

ports/ assume if build succeeded then binaries usually work, sans crashes. =
Only
shared libraries with no immediate consumers need -z defs. Turns out this i=
s no
longer true after bug 214864 e.g., ports r494319.

$ cat a.c
void foo(void);
void bar() { foo(); }

$ cat b.c
int main() {}

$ cc -fPIC -shared a.c -o a.so
$ cc b.c a.so
$ cc -fuse-ld=3Dbfd b.c a.so
/usr/local/bin/ld.bfd: a.so: undefined reference to `foo'
cc: error: linker command failed with exit code 1 (use -v to see invocation)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236141-29464>