This suggests a cool ld hack. gcc apparently uniquizes
strings in the compile stage, so I suppose it could make a list
list of string constants (it probably already can), that could
be uniquized at link stage. See the '-fwritable-strings' option in
the gcc man page. This would be useful in general, not just for
the kernel.
Food for thought:
$ objcopy -O binary -R .note -R .comment -S /usr/src/linux/vmlinux
$ ls -l /usr/src/linux/vmlinux
-rwxrwxr-x 1 ds ds 1128448 Jun 4 18:01 vmlinux
$ strings -n 5 /usr/src/linux/vmlinux |wc
6817 17886 129719
$ strings -n 5 /usr/src/linux/vmlinux |sort|uniq|wc
5819 16180 118741
Savings of about 10k, or about 1%. Not too shabby, since it would
be automatic.
dave...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/