bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/13314] New: ICF clashes with section ordering


From: mh-sourceware at glandium dot org
Subject: [Bug gold/13314] New: ICF clashes with section ordering
Date: Tue, 18 Oct 2011 06:15:10 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13314

             Bug #: 13314
           Summary: ICF clashes with section ordering
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified


When linking with ICF and section ordering, the resulting order may not
correspond to what is requested.

$ cat <<EOF > test.c
int foo(void) {return 0;}
int bar(void) {return 42;}
int baz(void) {return 42;}
EOF
$ cat <<EOF > order
.text.baz
.text.foo
.text.*
EOF
$ gcc -o test.so -shared test.c -Wl,--icf=all -Wl,--print-icf-sections -fPIC
-ffunction-sections -Wl,--section-ordering-file=order
$ objdump -T test.so | grep '\(foo\|bar\|baz\)' | sort
0000000000000636 g    DF .text    000000000000000b  Base        foo
0000000000000641 g    DF .text    000000000000000b  Base        bar
0000000000000641 g    DF .text    000000000000000b  Base        baz

What happens is that baz is folded in bar, and when reordering, only bar is
considered, not baz, so baz ends up after foo.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]