This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/54095] New: Unnecessary static variable renaming
- From: "rth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jul 2012 17:16:01 +0000
- Subject: [Bug lto/54095] New: Unnecessary static variable renaming
- Auto-submitted: auto-generated
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.