[53/58] Hide internal __moncontrol function [BZ #18822]

Message ID 20170901180029.9527-54-hjl.tools@gmail.com
State Committed
Commit fa4265909edaa5118f7860f452e2fb9da48d0f6e
Headers

Commit Message

H.J. Lu Sept. 1, 2017, 6 p.m. UTC
  Hide internal __moncontrol function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* mon/gmon.c (__moncontrol): Add libc_hidden_proto and
	libc_hidden_def.
---
 gmon/gmon.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

H.J. Lu Oct. 2, 2017, 12:56 a.m. UTC | #1
On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __moncontrol function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* mon/gmon.c (__moncontrol): Add libc_hidden_proto and
> 	libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.
  

Patch

diff --git a/gmon/gmon.c b/gmon/gmon.c
index 4e48eba1bf..f1aa3b776c 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -62,6 +62,7 @@  static int	s_scale;
 
 void moncontrol (int mode);
 void __moncontrol (int mode);
+libc_hidden_proto (__moncontrol)
 static void write_hist (int fd);
 static void write_call_graph (int fd);
 static void write_bb_counts (int fd);
@@ -93,6 +94,7 @@  __moncontrol (int mode)
       p->state = GMON_PROF_OFF;
     }
 }
+libc_hidden_def (__moncontrol)
 weak_alias (__moncontrol, moncontrol)