]> gcc.gnu.org Git - gcc.git/commitdiff
compiler: Always put descriptor wrappers in their own section.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 2 Aug 2013 17:01:43 +0000 (17:01 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 2 Aug 2013 17:01:43 +0000 (17:01 +0000)
This lets the linker GC them.

From-SVN: r201442

gcc/go/gofrontend/gogo.cc

index 6ae72b6a1c98b93c998af9e98b06fdc380425804..0b69d5d9887feecdfa1aa4983e13de60221838ed 100644 (file)
@@ -3582,6 +3582,12 @@ Function::make_descriptor_wrapper(Gogo* gogo, Named_object* no,
   Named_object* dno = gogo->start_function(name, new_fntype, false, loc);
   dno->func_value()->is_descriptor_wrapper_ = true;
 
+  // Put the wrapper in a unique section so that it can be discarded
+  // by the linker if it is not needed.  Every top-level function will
+  // get a wrapper, in case there is a reference other than a call
+  // from some other package, but most will not need one.
+  dno->func_value()->set_in_unique_section();
+
   gogo->start_block(loc);
 
   Expression* fn = Expression::make_func_reference(no, NULL, loc);
This page took 0.067444 seconds and 5 git commands to generate.