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
40fbfbea
Commit
40fbfbea
authored
Oct 08, 1993
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ROSE shared library profiling work; Use GOTOFF if possible for ELF.
From-SVN: r5684
parent
7868c466
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
4 deletions
+68
-4
gcc/config/i386/osfrose.h
+42
-4
gcc/halfpic.c
+24
-0
gcc/halfpic.h
+2
-0
No files found.
gcc/config/i386/osfrose.h
View file @
40fbfbea
...
...
@@ -182,11 +182,27 @@ do \
\
if (profile_flag && OSF_PROFILE_BEFORE_PROLOGUE) \
{ \
if (!flag_pic
)
\
if (!flag_pic
&& !HALF_PIC_P ())
\
{ \
fprintf (FILE, "\t
leal
%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\t
movl $
%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\tcall *%s_mcount_ptr\n", prefix); \
} \
\
else if (HALF_PIC_P ()) \
{ \
rtx symref; \
\
HALF_PIC_EXTERNAL ("_mcount_ptr"); \
symref = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, \
"_mcount_ptr")); \
\
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\tmovl %s%s,%%eax\n", prefix, \
XSTR (symref, 0)); \
fprintf (FILE, "\tmovl (%%eax),%%eax\n"); \
fprintf (FILE, "\tcall *%%eax\n"); \
} \
\
else \
{ \
static int call_no = 0; \
...
...
@@ -199,6 +215,7 @@ do \
lprefix, labelno); \
fprintf (FILE, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n", \
prefix); \
fprintf (FILE, "\tmovl (%%eax),%%eax\n"); \
fprintf (FILE, "\tcall *%%eax\n"); \
} \
} \
...
...
@@ -246,6 +263,17 @@ do \
fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \
} \
\
else if (TARGET_MCOUNT && HALF_PIC_P ()) \
{ \
rtx symdef; \
\
HALF_PIC_EXTERNAL ("mcount"); \
symdef = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, "mcount")); \
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\tmovl %s%s,%%eax\n", prefix, XSTR (symdef, 0)); \
fprintf (FILE, "\tcall *%%eax\n"); \
} \
\
else if (TARGET_MCOUNT) \
{ \
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
...
...
@@ -259,6 +287,7 @@ do \
fprintf (FILE, "\tleal $%sP%d@GOTOFF(%%ebx),%%edx\n", \
lprefix, labelno); \
fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%eax),%%eax\n"); \
fprintf (FILE, "\tmovl (%%eax),%%eax\n"); \
fprintf (FILE, "\tcall *%%eax\n"); \
fprintf (FILE, "\tpopl %%eax\n"); \
} \
...
...
@@ -267,7 +296,7 @@ do \
{ \
fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
fprintf (FILE, "\tpushl %%ecx\n"); \
fprintf (FILE, "\t
lea
l $%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\t
mov
l $%sP%d,%%edx\n", lprefix, labelno); \
fprintf (FILE, "\tcall *_mcount_ptr\n"); \
fprintf (FILE, "\tpopl %%eax\n"); \
} \
...
...
@@ -565,8 +594,17 @@ while (0)
#define ENCODE_SECTION_INFO(DECL) \
do \
{ \
if (HALF_PIC_P ())
\
if (HALF_PIC_P ())
\
HALF_PIC_ENCODE (DECL); \
\
else if (flag_pic) \
{ \
rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
= (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
|| ! TREE_PUBLIC (DECL)); \
} \
} \
while (0)
...
...
gcc/halfpic.c
View file @
40fbfbea
...
...
@@ -268,6 +268,30 @@ half_pic_declare (name)
}
/* Mark that an object is explicitly external. */
void
half_pic_external
(
name
)
char
*
name
;
{
struct
all_refs
*
ptr
;
if
(
!
flag_half_pic
)
return
;
ptr
=
half_pic_hash
(
name
,
0
,
TRUE
);
if
(
!
ptr
)
return
;
ptr
->
external_p
=
TRUE
;
#ifdef HALF_PIC_DEBUG
if
(
HALF_PIC_DEBUG
)
fprintf
(
stderr
,
"
\n
========== Half_pic_external %s
\n
"
,
name
);
#endif
}
/* Return whether an address is half-pic. */
int
...
...
gcc/halfpic.h
View file @
40fbfbea
...
...
@@ -57,6 +57,7 @@ extern int half_pic_number_ptrs; /* # distinct pointers found */
extern
int
half_pic_number_refs
;
/* # half-pic references */
extern
void
half_pic_encode
PROTO
((
union
tree_node
*
));
/* encode whether half-pic */
extern
void
half_pic_declare
PROTO
((
char
*
));
/* declare object local */
extern
void
half_pic_external
PROTO
((
char
*
));
/* declare object external */
extern
void
half_pic_init
PROTO
((
void
));
/* half_pic initialization */
extern
void
half_pic_finish
STDIO_PROTO
((
FILE
*
));
/* half_pic termination */
extern
int
half_pic_address_p
PROTO
((
struct
rtx_def
*
));
/* true if an address is half-pic */
...
...
@@ -71,6 +72,7 @@ extern struct rtx_def *half_pic_ptr PROTO((struct rtx_def *)); /* return RTX for
#define HALF_PIC_ENCODE(DECL) half_pic_encode (DECL)
#define HALF_PIC_DECLARE(NAME) half_pic_declare (NAME)
#define HALF_PIC_EXTERNAL(NAME) half_pic_external (NAME)
#define HALF_PIC_INIT() half_pic_init ()
#define HALF_PIC_FINISH(STREAM) half_pic_finish (STREAM)
#define HALF_PIC_ADDRESS_P(X) ((*ptr_half_pic_address_p) (X))
...
...
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