bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/18865] New: ICF --keep-unique doesn't work correctly


From: mail at tzik dot jp
Subject: [Bug gold/18865] New: ICF --keep-unique doesn't work correctly
Date: Tue, 25 Aug 2015 11:04:32 +0000

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

            Bug ID: 18865
           Summary: ICF --keep-unique doesn't work correctly
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: mail at tzik dot jp
                CC: ian at airs dot com
  Target Milestone: ---

ICF --keep-unique doesn't work correctly when a symbol is folded *into* the
--keep-unique'ed symbol.

A repro case is below:
$ cat > foo.c <<EOF
void f() {}
void g() {}
int main() {return 0;}
EOF
$ clang -fuse-ld=gold -Wl,--icf=all -ffunction-sections -Wl,--keep-unique=f -o
foo foo.c
$ nm -n foo | grep 'T .$'

The output of above was like this:
> 0000000000400580 T f
> 0000000000400580 T g
Where the address of f is expected to be unique.

I think this is due to the implementation of Icf::unfold_section.
It prevents a section (f) is folded into another section (g), though doesn't
prevents opposite, another section (g) is folded into the specified section
(f).

-- 
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]