This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/54095] New: Unnecessary static variable renaming


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54095

             Bug #: 54095
           Summary: Unnecessary static variable renaming
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rth@gcc.gnu.org


For example:

    # cat hello.c
    static int foo = 5;
    extern int bar(int *);
    main() {
      return bar(&foo);
    }
    # cc -flto -O hello.c -r -o hello.o -nostdlib
    # nm hello.o
                     U bar
    0000000000000000 d foo.2353.2353
    0000000000000000 T main

There is no other symbol foo within the partition, so there's no need to
rename the static symbol within the partition.

The linux kernel modversion and CRC checking is done using static symbols
in the kernel for each exported symbol.  Given that the exported symbols
must of course be unique, the kernel programmers know that the static symbols
holding the data that controls the exports must also be unique.  It would
be very nice to not have to adjust the modversion logic to deal with the
renames that lto currently induces.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]