When hot/cold function splitting occurs, a symbol is generated for the cold partition, and gets output in the assembly & debug info, but the symbol currently gets a size of 0 and a type of NOTYPE, as in this example (on x86_64-linux) from the cold_partition_label test in the testsuite: $ readelf -sW cold_partition_label.x02 | grep foo 36: 0000000000400450 0 NOTYPE LOCAL DEFAULT 12 foo.cold.0 58: 0000000000400490 43 FUNC GLOBAL DEFAULT 12 foo $ This patch fixes this by calculating the right size for the partition, and outputing the size and type fo the cold partition symbol. After applying this patch and looking at the same test, I get: $ readelf -sW cold_partition_label.x02 | grep foo 36: 0000000000400450 29 FUNC LOCAL DEFAULT 12 foo.cold.0 58: 0000000000400490 43 FUNC GLOBAL DEFAULT 12 foo $ This patch has been tested by bootstrapping the compiler, running the dejagnu testsuite with no regressions, and checked as shown above that it fixes the original problem. Is this patch OK to commit to ToT? -- Caroline Tice cmtice@google.com 2014-12-05 Caroline Tice * final.c (final_scan_insn): Change 'cold_function_name' to 'cold_partition_name' and make it a global variable; also output assembly to give it a 'FUNC' type, if appropriate. * varasm.c (cold_partition_name): Declare and initialize global variable. (assemble_start_function): Re-set value for cold_partition_name. (assemble_end_function): Output assembly to calculate size of cold partition, and associate size with name, if appropriate. * varash.h (cold_partition_name): Add extern declaration for global variable.