diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2019-11-09 13:43:04 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-11-09 13:43:04 +0000 |
commit | 95cc59f17b4f3f858879bd2fbc6bcf12a865a08c (patch) | |
tree | 785c75c7e4c096467b1c7996cac82892472ba8d0 /gcc/config/darwin.c | |
parent | 038d7e1b199fcc480cf24e344e8c4030591de026 (diff) | |
download | gcc-95cc59f17b4f3f858879bd2fbc6bcf12a865a08c.zip gcc-95cc59f17b4f3f858879bd2fbc6bcf12a865a08c.tar.gz gcc-95cc59f17b4f3f858879bd2fbc6bcf12a865a08c.tar.bz2 |
[Darwin, machopic 10/n] Rework X86 mcount stub code.
When a stub is used to call the mcount function, the code is already
marking it as used unconditionally; This is the only use of the so-
called validation outside darwin.{h,c}. This moves the 'validation'
into darwin.c which is a step towards making validation routine local.
gcc/
2019-11-09 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (machopic_mcount_stub_name): Validate the
symbol stub name when it is created.
* config/i386/darwin.h (FUNCTION_PROFILER): Remove the symbol
stub validation.
From-SVN: r278000
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index c0fafed..f34be22 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -601,15 +601,6 @@ machopic_indirection_name (rtx sym_ref, bool stub_p) return p->ptr_name; } -/* Return the name of the stub for the mcount function. */ - -const char* -machopic_mcount_stub_name (void) -{ - rtx symbol = gen_rtx_SYMBOL_REF (Pmode, "*mcount"); - return machopic_indirection_name (symbol, /*stub_p=*/true); -} - /* If NAME is the name of a stub or a non-lazy pointer , mark the stub or non-lazy pointer as used -- and mark the object to which the pointer/stub refers as used as well, since the pointer/stub will @@ -2155,6 +2146,20 @@ darwin_emit_except_table_label (FILE *file) except_table_label_num++); ASM_OUTPUT_LABEL (file, section_start_label); } + +/* Return, and mark as used, the name of the stub for the mcount function. + Currently, this is only called by X86 code in the expansion of the + FUNCTION_PROFILER macro, when stubs are enabled. */ + +const char* +machopic_mcount_stub_name (void) +{ + rtx symbol = gen_rtx_SYMBOL_REF (Pmode, "*mcount"); + const char *name = machopic_indirection_name (symbol, /*stub_p=*/true); + machopic_validate_stub_or_non_lazy_ptr (name); + return name; +} + /* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */ void |