This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google][4.6] Bug fixes to function reordering linker plugin to handle local and comdat functions. (issue 5851044)
- From: tmsriram at google dot com
- To: eraman at google dot com, davidxl at google dot com
- Cc: gcc-patches at gcc dot gnu dot org, davidxl at google dot com, reply at codereview-hr dot appspotmail dot com
- Date: Wed, 21 Mar 2012 04:17:51 +0000
- Subject: Re: [google][4.6] Bug fixes to function reordering linker plugin to handle local and comdat functions. (issue 5851044)
- Reply-to: tmsriram at google dot com, eraman at google dot com, davidxl at google dot com, gcc-patches at gcc dot gnu dot org, reply at codereview-hr dot appspotmail dot com
Uploaded new patch.
On 2012/03/20 19:25:38, davidxl wrote:
It would be nice to add some unit/regression test cases of some sort.
Made the existing unit test case check the final layout.
David
http://codereview.appspot.com/5851044/diff/1/callgraph.c
File callgraph.c (right):
http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode309
callgraph.c:309: if (!is_prefix_of ("_ZL", name))
How about static functions in namespace? How about functions in
anonymous
namespace?
Thanks for pointing this out. One solution is to add more plugin
interfaces to plugin-api.h to find the section flags and the section
group. This way, comdats can be detected. All other duplicates can be
treated as file static functions. I marked this as TODO for now.
I am also thinking of sending a patch to generate unique section names
for file static functions. This will help --section-ordering-file in
gold too.
http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode511
callgraph.c:511: ".text." };
How are the sections ordered in the array? Keep it in mind that it is
possible
to encode the actual profile count of the function in the section name
in the
future.
Right, for now this parsing will work. The parsing needs to be updated
once the section names change.
http://codereview.appspot.com/5851044/