Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ef179a26
Commit
ef179a26
authored
May 07, 1999
by
Nick Clifton
Committed by
Nick Clifton
May 07, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply patch from Nick Burrett <nick.burrett@btinternet.com>
to implementn -mpoke-function-name From-SVN: r26817
parent
6c9ef6d4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
11 deletions
+81
-11
gcc/ChangeLog
+12
-0
gcc/config/arm/aof.h
+2
-0
gcc/config/arm/aout.h
+6
-1
gcc/config/arm/arm.c
+45
-0
gcc/config/arm/arm.h
+2
-0
gcc/config/arm/elf.h
+14
-10
No files found.
gcc/ChangeLog
View file @
ef179a26
Fri
May
7
09
:
54
:
11
1999
Nick
Clifton
<
nickc
@cygnus
.
com
>
Patch
from
:
Nick
Burrett
<
nick
.
burrett
@btinternet
.
com
>
*
arm
.
c
(
arm_poke_function_name
)
:
New
function
to
implement
-
mpoke
-
function
-
name
.
*
aof
.
h
(
ASM_DECLARE_FUNCTION_NAME
)
:
Call
it
.
*
aout
.
h
(
ASM_DECLARE_FUNCTION_NAME
)
:
Likewise
.
*
elf
.
h
(
ASM_DECLARE_FUNCTION_NAME
)
:
Likewise
.
*
arm
.
h
:
Prototype
it
.
(
TARGET_SWITCHES
)
:
Add
`
no
-
poke
-
function
-
name
'
.
Fri
May
7
14
:
19
:
31
1999
Rainer
Orth
<
ro
@TechFak
.
Uni
-
Bielefeld
.
DE
>
Fri
May
7
14
:
19
:
31
1999
Rainer
Orth
<
ro
@TechFak
.
Uni
-
Bielefeld
.
DE
>
*
fixinc
/
server
.
c
(
read_pipe_timeout
)
:
Declare
volatile
,
modified
*
fixinc
/
server
.
c
(
read_pipe_timeout
)
:
Declare
volatile
,
modified
in
signal
handler
.
in
signal
handler
.
...
...
gcc/config/arm/aof.h
View file @
ef179a26
...
@@ -324,6 +324,8 @@ do { \
...
@@ -324,6 +324,8 @@ do { \
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
{ \
{ \
if (TARGET_POKE_FUNCTION_NAME) \
arm_poke_function_name ((STREAM), (NAME)); \
ASM_OUTPUT_LABEL (STREAM, NAME); \
ASM_OUTPUT_LABEL (STREAM, NAME); \
if (! TREE_PUBLIC (DECL)) \
if (! TREE_PUBLIC (DECL)) \
{ \
{ \
...
...
gcc/config/arm/aout.h
View file @
ef179a26
...
@@ -129,7 +129,12 @@ do { \
...
@@ -129,7 +129,12 @@ do { \
/* Output a function label definition. */
/* Output a function label definition. */
#ifndef ASM_DECLARE_FUNCTION_NAME
#ifndef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) ASM_OUTPUT_LABEL (STREAM, NAME)
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
{ \
if (TARGET_POKE_FUNCTION_NAME) \
arm_poke_function_name ((STREAM), (NAME)); \
ASM_OUTPUT_LABEL (STREAM, NAME); \
}
#endif
#endif
#ifndef ASM_OUTPUT_LABEL
#ifndef ASM_OUTPUT_LABEL
...
...
gcc/config/arm/arm.c
View file @
ef179a26
...
@@ -5398,6 +5398,51 @@ arm_volatile_func ()
...
@@ -5398,6 +5398,51 @@ arm_volatile_func ()
return
(
optimize
>
0
&&
TREE_THIS_VOLATILE
(
current_function_decl
));
return
(
optimize
>
0
&&
TREE_THIS_VOLATILE
(
current_function_decl
));
}
}
/* Write the function name into the code section, directly preceding
the function prologue.
Code will be output similar to this:
t0
.ascii "arm_poke_function_name", 0
.align
t1
.word 0xff000000 + (t1 - t0)
arm_poke_function_name
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
When performing a stack backtrace, code can inspect the value
of 'pc' stored at 'fp' + 0. If the trace function then looks
at location pc - 12 and the top 8 bits are set, then we know
that there is a function name embedded immediately preceding this
location and has length ((pc[-3]) & 0xff000000).
We assume that pc is declared as a pointer to an unsigned long.
It is of no benefit to output the function name if we are assembling
a leaf function. These function types will not contain a stack
backtrace structure, therefore it is not possible to determine the
function name. */
void
arm_poke_function_name
(
stream
,
name
)
FILE
*
stream
;
char
*
name
;
{
unsigned
long
alignlength
;
unsigned
long
length
;
rtx
x
;
length
=
strlen
(
name
);
alignlength
=
(
length
+
1
)
+
3
&
~
3
;
ASM_OUTPUT_ASCII
(
stream
,
name
,
length
+
1
);
ASM_OUTPUT_ALIGN
(
stream
,
2
);
x
=
GEN_INT
(
0xff000000UL
+
alignlength
);
ASM_OUTPUT_INT
(
stream
,
x
);
}
/* The amount of stack adjustment that happens here, in output_return and in
/* The amount of stack adjustment that happens here, in output_return and in
output_epilogue must be exactly the same as was calculated during reload,
output_epilogue must be exactly the same as was calculated during reload,
or things will point to the wrong place. The only time we can safely
or things will point to the wrong place. The only time we can safely
...
...
gcc/config/arm/arm.h
View file @
ef179a26
...
@@ -346,6 +346,7 @@ function tries to return. */
...
@@ -346,6 +346,7 @@ function tries to return. */
{"no-apcs-frame", -ARM_FLAG_APCS_FRAME, "" }, \
{"no-apcs-frame", -ARM_FLAG_APCS_FRAME, "" }, \
{"poke-function-name", ARM_FLAG_POKE, \
{"poke-function-name", ARM_FLAG_POKE, \
"Store function names in object code" }, \
"Store function names in object code" }, \
{"no-poke-function-name", -ARM_FLAG_POKE, "" }, \
{"fpe", ARM_FLAG_FPE, "" }, \
{"fpe", ARM_FLAG_FPE, "" }, \
{"apcs-32", ARM_FLAG_APCS_32, \
{"apcs-32", ARM_FLAG_APCS_32, \
"Use the 32bit version of the APCS" }, \
"Use the 32bit version of the APCS" }, \
...
@@ -2190,6 +2191,7 @@ char * arithmetic_instr PROTO ((Rtx, int));
...
@@ -2190,6 +2191,7 @@ char * arithmetic_instr PROTO ((Rtx, int));
void
output_ascii_pseudo_op
STDIO_PROTO
((
FILE
*
,
unsigned
char
*
,
int
));
void
output_ascii_pseudo_op
STDIO_PROTO
((
FILE
*
,
unsigned
char
*
,
int
));
char
*
output_return_instruction
PROTO
((
Rtx
,
int
,
int
));
char
*
output_return_instruction
PROTO
((
Rtx
,
int
,
int
));
int
arm_volatile_func
PROTO
((
void
));
int
arm_volatile_func
PROTO
((
void
));
void
arm_poke_function_name
STDIO_PROTO
((
FILE
*
,
char
*
));
void
output_func_prologue
STDIO_PROTO
((
FILE
*
,
int
));
void
output_func_prologue
STDIO_PROTO
((
FILE
*
,
int
));
void
output_func_epilogue
STDIO_PROTO
((
FILE
*
,
int
));
void
output_func_epilogue
STDIO_PROTO
((
FILE
*
,
int
));
void
arm_expand_prologue
PROTO
((
void
));
void
arm_expand_prologue
PROTO
((
void
));
...
...
gcc/config/arm/elf.h
View file @
ef179a26
...
@@ -60,16 +60,20 @@ Boston, MA 02111-1307, USA. */
...
@@ -60,16 +60,20 @@ Boston, MA 02111-1307, USA. */
/* Write the extra assembler code needed to declare a function properly.
/* Write the extra assembler code needed to declare a function properly.
Some svr4 assemblers need to also have something extra said about the
Some svr4 assemblers need to also have something extra said about the
function's return value. We allow for that here. */
function's return value. We allow for that here. */
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \
do \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
{ \
assemble_name (FILE, NAME); \
if (TARGET_POKE_FUNCTION_NAME) \
putc (',', FILE); \
arm_poke_function_name (FILE, NAME); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
putc ('\n', FILE); \
assemble_name (FILE, NAME); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
putc (',', FILE); \
ASM_OUTPUT_LABEL(FILE, NAME); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
} while (0)
putc ('\n', FILE); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
ASM_OUTPUT_LABEL(FILE, NAME); \
} \
while (0)
/* Write the extra assembler code needed to declare an object properly. */
/* Write the extra assembler code needed to declare an object properly. */
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment