This is the mail archive of the mailing list for the binutils 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]

gold patch to discard .note.callgraph sections in the final link.


  I am working on a project to global function layout in the linker
where the linker reads the callgraph edge profile information,
generated by FDO, and uses that to find a ordering of functions that
will place functions calling each other frequently closer.  To do
this, I create special .note sections, called .note.callgraph which
records the callgraph edge profile info. Please see :

  This patch is to make gold omit these sections in the final link
except when generating relocatable objects. Is this ok to submit?

        * (Sized_relobj_file<size, big_endian>::do_layout):
	Omit .note.callgraph sections in the final link.

RCS file: /cvs/src/src/gold/,v
retrieving revision 1.150
diff -u -u -p -r1.150
---	18 Sep 2011 15:06:28 -0000	1.150
+++	22 Sep 2011 17:33:52 -0000
@@ -1315,6 +1315,14 @@ Sized_relobj_file<size, big_endian>::do_
 		omit[i] = true;

+	  // This section is special.  It records the callgraph edge profile
+	  // information.  It should be omitted after its contents are read.
+	  if (is_prefix_of(".note.callgraph.text", name))
+	    {
+	      if (!relocatable)
+	        omit[i] = true;
+	    }


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