Commit 7d7c187b authored by Simon Marlow's avatar Simon Marlow
Browse files

Declare RTS-private prototypes with __attribute__((visibility("hidden")))

This has no effect with static libraries, but when the RTS is in a
shared library it does two things:

 - it prevents the function from being exposed by the shared library

 - internal calls to the function can use the faster non-PLT calls,
   because the function cannot be overriden at link time.
parent acdd7c95
......@@ -208,9 +208,9 @@ extern RTS_FLAGS RtsFlags;
/* Routines that operate-on/to-do-with RTS flags: */
extern void initRtsFlagsDefaults(void);
extern void setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]);
extern void setProgName(char *argv[]);
void initRtsFlagsDefaults(void);
void setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]);
void setProgName(char *argv[]);
/*
......
......@@ -11,19 +11,19 @@
// canned slow entry points, indexed by arg type (ARG_P, ARG_PP, etc.)
#ifdef IN_STG_CODE
extern StgWord stg_ap_stack_entries[];
extern RTS_PRIVATE StgWord stg_ap_stack_entries[];
#else
extern StgFun *stg_ap_stack_entries[];
extern RTS_PRIVATE StgFun *stg_ap_stack_entries[];
#endif
// canned register save code for heap check failure in a function
#ifdef IN_STG_CODE
extern StgWord stg_stack_save_entries[];
extern RTS_PRIVATE StgWord stg_stack_save_entries[];
#else
extern StgFun *stg_stack_save_entries[];
extern RTS_PRIVATE StgFun *stg_stack_save_entries[];
#endif
// canned bitmap for each arg type
extern StgWord stg_arg_bitmaps[];
extern RTS_PRIVATE StgWord stg_arg_bitmaps[];
#endif /* APPLY_H */
......@@ -11,15 +11,15 @@
typedef struct _Arena Arena;
// Start a new arena
extern Arena * newArena ( void );
RTS_PRIVATE Arena * newArena ( void );
// Allocate memory in an arena
extern void * arenaAlloc ( Arena *, size_t );
RTS_PRIVATE void * arenaAlloc ( Arena *, size_t );
// Free an entire arena
extern void arenaFree ( Arena * );
RTS_PRIVATE void arenaFree ( Arena * );
// For internal use only:
extern unsigned long arenaBlocks( void );
RTS_PRIVATE unsigned long arenaBlocks( void );
#endif /* ARENA_H */
......@@ -17,8 +17,8 @@
* Called from STG : NO
* Locks assumed : sched_mutex
*/
void awaitEvent(rtsBool wait); /* In posix/Select.c or
* win32/AwaitEvent.c */
RTS_PRIVATE void awaitEvent(rtsBool wait); /* In posix/Select.c or
* win32/AwaitEvent.c */
#endif
#endif /* AWAITEVENT_H */
......@@ -22,6 +22,8 @@
#include "Task.h"
#include "Sparks.h"
#pragma GCC visibility push(hidden)
struct Capability_ {
// State required by the STG virtual machine when running Haskell
// code. During STG execution, the BaseReg register always points
......@@ -330,4 +332,6 @@ contextSwitchCapability (Capability *cap)
cap->context_switch = 1;
}
#pragma GCC visibility pop
#endif /* CAPABILITY_H */
......@@ -11,8 +11,8 @@
#ifdef DEBUG
extern int disInstr ( StgBCO *bco, int pc );
extern void disassemble( StgBCO *bco );
RTS_PRIVATE int disInstr ( StgBCO *bco, int pc );
RTS_PRIVATE void disassemble( StgBCO *bco );
#endif
......
......@@ -9,6 +9,8 @@
#ifndef FRONTPANEL_H
#define FRONTPANEL_H
#pragma GCC visibility push(hidden)
#ifdef RTS_GTK_FRONTPANEL
#include "Rts.h" /* needed because this file gets included by
......@@ -31,5 +33,7 @@ extern gboolean continue_now, stop_now, quit;
#endif /* RTS_GTK_FRONTPANEL */
#pragma GCC visibility pop
#endif /* FRONTPANEL_H */
......@@ -9,6 +9,8 @@
#ifndef GETTIME_H
#define GETTIME_H
#pragma GCC visibility push(hidden)
// We'll use a fixed resolution of usec for now. The machine
// dependent implementation may have a different resolution, but we'll
// normalise to this for the machine independent interface.
......@@ -23,4 +25,6 @@ void getProcessTimes (Ticks *user, Ticks *elapsed);
// Not strictly timing, but related
nat getPageFaults (void);
#pragma GCC visibility pop
#endif /* GETTIME_H */
......@@ -12,8 +12,8 @@
#ifndef GLOBALS_H
#define GLOBALS_H
void initGlobalStore(void);
void exitGlobalStore(void);
RTS_PRIVATE void initGlobalStore(void);
RTS_PRIVATE void exitGlobalStore(void);
#endif
......@@ -9,6 +9,8 @@
#ifndef HASH_H
#define HASH_H
#pragma GCC visibility push(hidden)
typedef struct hashtable HashTable; /* abstract */
/* Hash table access where the keys are StgWords */
......@@ -45,5 +47,7 @@ void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) );
void exitHashTable ( void );
#pragma GCC visibility pop
#endif /* HASH_H */
......@@ -9,6 +9,6 @@
#ifndef INTERPRETER_H
#define INTERPRETER_H
extern Capability *interpretBCO (Capability* cap);
RTS_PRIVATE Capability *interpretBCO (Capability* cap);
#endif /* INTERPRETER_H */
......@@ -14,8 +14,8 @@
#include "ProfHeap.h"
extern void LdvCensusForDead ( nat );
extern void LdvCensusKillAll ( void );
RTS_PRIVATE void LdvCensusForDead ( nat );
RTS_PRIVATE void LdvCensusKillAll ( void );
// Creates a 0-filled slop of size 'howManyBackwards' backwards from the
// address 'from'.
......
......@@ -8,6 +8,8 @@
#ifndef PAPI_H
#define PAPI_H
#pragma GCC visibility push(hidden)
/* Check the error value of a PAPI call, reporting an error, if needed */
extern int papi_error;
......@@ -29,4 +31,6 @@ void papi_stop_gc1_count(void);
void papi_thread_start_gc1_count(int event_set);
void papi_thread_stop_gc1_count(int event_set);
#pragma GCC visibility pop
#endif /* PAPI_H */
......@@ -9,6 +9,8 @@
#ifndef PRINTER_H
#define PRINTER_H
#pragma GCC visibility push(hidden)
extern void printPtr ( StgPtr p );
extern void printObj ( StgClosure *obj );
......@@ -30,5 +32,7 @@ extern void DEBUG_LoadSymbols( char *name );
extern const char *lookupGHCName( void *addr );
#endif
#pragma GCC visibility pop
#endif /* PRINTER_H */
......@@ -9,10 +9,14 @@
#ifndef PROFHEAP_H
#define PROFHEAP_H
extern void heapCensus( void );
extern nat initHeapProfiling( void );
extern void endHeapProfiling( void );
extern void LDV_recordDead( StgClosure *c, nat size );
extern rtsBool strMatchesSelector( char* str, char* sel );
#pragma GCC visibility push(hidden)
void heapCensus (void);
nat initHeapProfiling (void);
void endHeapProfiling (void);
void LDV_recordDead (StgClosure *c, nat size);
rtsBool strMatchesSelector (char* str, char* sel);
#pragma GCC visibility pop
#endif /* PROFHEAP_H */
......@@ -11,6 +11,8 @@
#include <stdio.h>
#pragma GCC visibility push(hidden)
void initProfiling1 (void);
void freeProfiling1 (void);
void initProfiling2 (void);
......@@ -21,18 +23,20 @@ extern FILE *hp_file;
#ifdef PROFILING
void gen_XML_logfile ( void );
void gen_XML_logfile ( void );
void reportCCSProfiling ( void );
void PrintNewStackDecls ( void );
extern void fprintCCS( FILE *f, CostCentreStack *ccs );
extern void fprintCCS_stderr( CostCentreStack *ccs );
void fprintCCS( FILE *f, CostCentreStack *ccs );
void fprintCCS_stderr( CostCentreStack *ccs );
#ifdef DEBUG
extern void debugCCS( CostCentreStack *ccs );
void debugCCS( CostCentreStack *ccs );
#endif
#endif
#pragma GCC visibility pop
#endif /* PROFILING_H */
......@@ -9,17 +9,21 @@
#ifndef PROFTIMER_H
#define PROFTIMER_H
extern void initProfTimer ( void );
extern void handleProfTick ( void );
#pragma GCC visibility push(hidden)
void initProfTimer ( void );
void handleProfTick ( void );
#ifdef PROFILING
extern void stopProfTimer ( void );
extern void startProfTimer ( void );
void stopProfTimer ( void );
void startProfTimer ( void );
#endif
extern void stopHeapProfTimer ( void );
extern void startHeapProfTimer ( void );
void stopHeapProfTimer ( void );
void startHeapProfTimer ( void );
extern rtsBool performHeapProfile;
#pragma GCC visibility pop
#endif /* PROFTIMER_H */
......@@ -9,6 +9,8 @@
#ifndef RAISEASYNC_H
#define RAISEASYNC_H
#pragma GCC visibility push(hidden)
#define THROWTO_SUCCESS 0
#define THROWTO_BLOCKED 1
......@@ -66,5 +68,7 @@ interruptible(StgTSO *t)
#endif /* CMINUSMINUS */
#pragma GCC visibility pop
#endif /* RAISEASYNC_H */
......@@ -14,10 +14,12 @@
#include "RetainerSet.h"
extern void initRetainerProfiling ( void );
extern void endRetainerProfiling ( void );
extern void retainerProfile ( void );
extern void resetStaticObjectForRetainerProfiling( StgClosure *static_objects );
#pragma GCC visibility push(hidden)
void initRetainerProfiling ( void );
void endRetainerProfiling ( void );
void retainerProfile ( void );
void resetStaticObjectForRetainerProfiling( StgClosure *static_objects );
extern StgWord flip;
......@@ -41,6 +43,8 @@ retainerSetOf( StgClosure *c )
extern lnat retainerStackBlocks ( void );
#endif
#pragma GCC visibility pop
#endif /* PROFILING */
#endif /* RETAINERPROFILE_H */
......@@ -14,6 +14,8 @@
#ifdef PROFILING
#pragma GCC visibility push(hidden)
/*
Type 'retainer' defines the retainer identity.
......@@ -197,5 +199,7 @@ void outputAllRetainerSet(FILE *);
// the best place to define it.
void printRetainer(FILE *, retainer);
#pragma GCC visibility pop
#endif /* PROFILING */
#endif /* RETAINERSET_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment