bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/21306] New: Different behavior when linking common symbol static


From: eric.schweitz at pgroup dot com
Subject: [Bug ld/21306] New: Different behavior when linking common symbol statically or to shared object
Date: Fri, 24 Mar 2017 19:33:10 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21306

            Bug ID: 21306
           Summary: Different behavior when linking common symbol
                    statically or to shared object
           Product: binutils
           Version: 2.27
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: eric.schweitz at pgroup dot com
  Target Milestone: ---

Created attachment 9942
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9942&action=edit
reproduces behavior shown in report

We discovered a change in behavior from Ubuntu 15.10 to Ubuntu 16.04. The
difference appears to be the former has

  GNU ld (GNU Binutils for Ubuntu) 2.25.1

and the latter

  GNU ld (GNU Binutils for Ubuntu) 2.26.1

Attached is a stripped down example. With ld 2.25.1, we observe that the
tentative definition of globalInt is resolved to the definition appearing in
con.o (static) or libcon.so (shared). 

% ./app.static 
globalInt is 7
% LD_LIBRARY_PATH=. ./app.shared
globalInt is 7

In ld 2.26.1, we observe that the tentative definition gets resolved the same
way with the static link, but does not get resolved with the shared link the
same way. Instead, the tentative definition is resolved to a new, secondary
instance (in .bss rather than .data).

% ./app.static 
globalInt is 7
% LD_LIBRARY_PATH=. ./app.shared
globalInt is 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]