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
4c23f36f
Commit
4c23f36f
authored
Mar 21, 1992
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r557
parent
1679e11f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
33 deletions
+54
-33
gcc/mips-tfile.c
+54
-33
No files found.
gcc/mips-tfile.c
View file @
4c23f36f
...
@@ -616,7 +616,7 @@ typedef const void *CPTR_T;
...
@@ -616,7 +616,7 @@ typedef const void *CPTR_T;
#define __proto(x) x
#define __proto(x) x
#else
#else
#if
def _STDIO_H_
/* Ultrix 4.0
*/
#if
defined(_STDIO_H_) || defined(__STDIO_H__)
/* Ultrix 4.0, SGI
*/
typedef
void
*
PTR_T
;
typedef
void
*
PTR_T
;
typedef
void
*
CPTR_T
;
typedef
void
*
CPTR_T
;
...
@@ -640,18 +640,13 @@ typedef char *CPTR_T;
...
@@ -640,18 +640,13 @@ typedef char *CPTR_T;
#define Size_t unsigned int
#define Size_t unsigned int
#define Ptrdiff_t int
#define Ptrdiff_t int
#define CODE_MASK 0x8F300
#define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
#define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
/* The following might be called from obstack or malloc,
/* The following might be called from obstack or malloc,
so they can't be static. */
so they can't be static. */
extern
void
pfatal_with_name
extern
void
pfatal_with_name
__proto
((
char
*
));
__proto
((
char
*
));
extern
void
fancy_abort
__proto
((
void
));
extern
void
fancy_abort
__proto
((
void
));
extern
void
botch
__proto
((
const
char
*
));
void
botch
__proto
((
const
char
*
));
extern
PTR_T
xmalloc
__proto
((
Size_t
));
extern
PTR_T
xmalloc
__proto
((
Size_t
));
extern
PTR_T
xcalloc
__proto
((
Size_t
,
Size_t
));
extern
PTR_T
xcalloc
__proto
((
Size_t
,
Size_t
));
extern
PTR_T
xrealloc
__proto
((
PTR_T
,
Size_t
));
extern
PTR_T
xrealloc
__proto
((
PTR_T
,
Size_t
));
...
@@ -689,8 +684,8 @@ main ()
...
@@ -689,8 +684,8 @@ main ()
#include <signal.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/stat.h>
#if
def USG
#if
defined (USG) || defined (NO_STAB_H)
#include "stab.h"
/* If doing DBX on sysV, use our own stab.h. */
#include "
g
stab.h"
/* If doing DBX on sysV, use our own stab.h. */
#else
#else
#include <stab.h>
/* On BSD, use the system's stab.h. */
#include <stab.h>
/* On BSD, use the system's stab.h. */
#endif
/* not USG */
#endif
/* not USG */
...
@@ -1598,6 +1593,7 @@ static int version = 0; /* print version # */
...
@@ -1598,6 +1593,7 @@ static int version = 0; /* print version # */
static
int
had_errors
=
0
;
/* != 0 if errors were found */
static
int
had_errors
=
0
;
/* != 0 if errors were found */
static
int
rename_output
=
0
;
/* != 0 if rename output file*/
static
int
rename_output
=
0
;
/* != 0 if rename output file*/
static
int
delete_input
=
0
;
/* != 0 if delete input after done */
static
int
delete_input
=
0
;
/* != 0 if delete input after done */
static
int
stabs_seen
=
0
;
/* != 0 if stabs have been seen */
/* Pseudo symbol to use when putting stabs into the symbol table. */
/* Pseudo symbol to use when putting stabs into the symbol table. */
...
@@ -1680,6 +1676,7 @@ STATIC char *st_to_string __proto((st_t));
...
@@ -1680,6 +1676,7 @@ STATIC char *st_to_string __proto((st_t));
STATIC
char
*
sc_to_string
__proto
((
sc_t
));
STATIC
char
*
sc_to_string
__proto
((
sc_t
));
STATIC
char
*
read_line
__proto
((
void
));
STATIC
char
*
read_line
__proto
((
void
));
STATIC
void
parse_input
__proto
((
void
));
STATIC
void
parse_input
__proto
((
void
));
STATIC
void
mark_stabs
__proto
((
const
char
*
));
STATIC
void
parse_begin
__proto
((
const
char
*
));
STATIC
void
parse_begin
__proto
((
const
char
*
));
STATIC
void
parse_bend
__proto
((
const
char
*
));
STATIC
void
parse_bend
__proto
((
const
char
*
));
STATIC
void
parse_def
__proto
((
const
char
*
));
STATIC
void
parse_def
__proto
((
const
char
*
));
...
@@ -1720,6 +1717,12 @@ STATIC void free_scope __proto((scope_t *));
...
@@ -1720,6 +1717,12 @@ STATIC void free_scope __proto((scope_t *));
STATIC
void
free_tag
__proto
((
tag_t
*
));
STATIC
void
free_tag
__proto
((
tag_t
*
));
STATIC
void
free_thead
__proto
((
thead_t
*
));
STATIC
void
free_thead
__proto
((
thead_t
*
));
/* rms: The following is a very bad idea.
It's easy for these to conflict with definitions on certain systems.
All system calls and library functions
for which an implicit definition will work
should be left implicit.
I deleted the declarations for open and fstat. */
/* Prototypes for library functions used. */
/* Prototypes for library functions used. */
#if !defined(NO_LIB_PROTOTYPE) && !defined(_OSF_SOURCE) && !defined(_STDIO_H_)
#if !defined(NO_LIB_PROTOTYPE) && !defined(_OSF_SOURCE) && !defined(_STDIO_H_)
extern
char
*
strchr
__proto
((
const
char
*
,
int
));
extern
char
*
strchr
__proto
((
const
char
*
,
int
));
...
@@ -1740,7 +1743,6 @@ extern FILE *freopen __proto((const char *, const char *, FILE *));
...
@@ -1740,7 +1743,6 @@ extern FILE *freopen __proto((const char *, const char *, FILE *));
extern
int
fflush
__proto
((
FILE
*
));
extern
int
fflush
__proto
((
FILE
*
));
extern
void
perror
__proto
((
const
char
*
));
extern
void
perror
__proto
((
const
char
*
));
extern
void
exit
__proto
((
int
));
extern
void
exit
__proto
((
int
));
extern
int
open
__proto
((
const
char
*
,
int
,
...));
extern
int
rename
__proto
((
const
char
*
,
const
char
*
));
extern
int
rename
__proto
((
const
char
*
,
const
char
*
));
#ifndef sgi
#ifndef sgi
...
@@ -1765,7 +1767,6 @@ extern int write __proto((int, CPTR_T, Size_t));
...
@@ -1765,7 +1767,6 @@ extern int write __proto((int, CPTR_T, Size_t));
extern
int
read
__proto
((
int
,
PTR_T
,
Size_t
));
extern
int
read
__proto
((
int
,
PTR_T
,
Size_t
));
extern
long
lseek
__proto
((
int
,
long
,
int
));
extern
long
lseek
__proto
((
int
,
long
,
int
));
extern
int
ftruncate
__proto
((
int
,
long
));
extern
int
ftruncate
__proto
((
int
,
long
));
extern
int
fstat
__proto
((
int
,
struct
stat
*
));
#endif
#endif
extern
char
*
mktemp
__proto
((
char
*
));
extern
char
*
mktemp
__proto
((
char
*
));
...
@@ -1773,6 +1774,8 @@ extern char *mktemp __proto((char *));
...
@@ -1773,6 +1774,8 @@ extern char *mktemp __proto((char *));
extern
char
*
optarg
;
extern
char
*
optarg
;
extern
int
optind
;
extern
int
optind
;
extern
int
opterr
;
extern
int
opterr
;
extern
char
*
version_string
;
extern
char
*
sys_siglist
[
NSIG
+
1
];
#ifndef SEEK_SET
/* Symbolic constants for the "fseek" function: */
#ifndef SEEK_SET
/* Symbolic constants for the "fseek" function: */
#define SEEK_SET 0
/* Set file pointer to offset */
#define SEEK_SET 0
/* Set file pointer to offset */
...
@@ -1803,6 +1806,7 @@ static pseudo_ops_t pseudo_ops[] = {
...
@@ -1803,6 +1806,7 @@ static pseudo_ops_t pseudo_ops[] = {
{
"#.stabn"
,
sizeof
(
"#.stabn"
)
-
1
,
parse_stabn
},
{
"#.stabn"
,
sizeof
(
"#.stabn"
)
-
1
,
parse_stabn
},
{
".stabs"
,
sizeof
(
".stabs"
)
-
1
,
parse_stabs
},
{
".stabs"
,
sizeof
(
".stabs"
)
-
1
,
parse_stabs
},
{
".stabn"
,
sizeof
(
".stabn"
)
-
1
,
parse_stabn
},
{
".stabn"
,
sizeof
(
".stabn"
)
-
1
,
parse_stabn
},
{
"#@stabs"
,
sizeof
(
"#@stabs"
)
-
1
,
mark_stabs
},
};
};
...
@@ -2794,13 +2798,13 @@ parse_begin (start)
...
@@ -2794,13 +2798,13 @@ parse_begin (start)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
{
{
error
(
"#.begin directive without a prece
e
ding .file directive"
);
error
(
"#.begin directive without a preceding .file directive"
);
return
;
return
;
}
}
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
{
{
error
(
"#.begin directive without a prece
e
ding .ent directive"
);
error
(
"#.begin directive without a preceding .ent directive"
);
return
;
return
;
}
}
...
@@ -2844,13 +2848,13 @@ parse_bend (start)
...
@@ -2844,13 +2848,13 @@ parse_bend (start)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
{
{
error
(
"#.begin directive without a prece
e
ding .file directive"
);
error
(
"#.begin directive without a preceding .file directive"
);
return
;
return
;
}
}
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
{
{
error
(
"#.bend directive without a prece
e
ding .ent directive"
);
error
(
"#.bend directive without a preceding .ent directive"
);
return
;
return
;
}
}
...
@@ -3465,13 +3469,13 @@ parse_end (start)
...
@@ -3465,13 +3469,13 @@ parse_end (start)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
{
{
error
(
".end directive without a prece
e
ding .file directive"
);
error
(
".end directive without a preceding .file directive"
);
return
;
return
;
}
}
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
if
(
cur_proc_ptr
==
(
PDR
*
)
0
)
{
{
error
(
".end directive without a prece
e
ding .ent directive"
);
error
(
".end directive without a preceding .ent directive"
);
return
;
return
;
}
}
...
@@ -3525,7 +3529,7 @@ parse_ent (start)
...
@@ -3525,7 +3529,7 @@ parse_ent (start)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
if
(
cur_file_ptr
==
(
efdr_t
*
)
0
)
{
{
error
(
".ent directive without a prece
e
ding .file directive"
);
error
(
".ent directive without a preceding .file directive"
);
return
;
return
;
}
}
...
@@ -3580,6 +3584,24 @@ parse_file (start)
...
@@ -3580,6 +3584,24 @@ parse_file (start)
}
}
/* Make sure the @stabs symbol is emitted. */
static
void
mark_stabs
(
start
)
char
*
start
;
/* Start of directive (ignored) */
{
if
(
!
stabs_seen
)
{
/* Add a dummy @stabs dymbol. */
stabs_seen
=
1
;
(
void
)
add_local_symbol
(
stabs_symbol
,
stabs_symbol
+
sizeof
(
stabs_symbol
),
stNil
,
scInfo
,
-
1
,
MIPS_MARK_STAB
(
0
));
}
}
/* Parse .stabs directives.
/* Parse .stabs directives.
.stabs directives have five fields:
.stabs directives have five fields:
...
@@ -3622,15 +3644,9 @@ parse_stabs_common (string_start, string_end, rest)
...
@@ -3622,15 +3644,9 @@ parse_stabs_common (string_start, string_end, rest)
st_t
st
;
st_t
st
;
sc_t
sc
;
sc_t
sc
;
int
ch
;
int
ch
;
static
int
stabs_seen
=
0
;
if
(
stabs_seen
++
==
0
)
if
(
stabs_seen
==
0
)
{
mark_stabs
(
""
);
/* Add a dummy @stabs dymbol. */
(
void
)
add_local_symbol
(
stabs_symbol
,
stabs_symbol
+
sizeof
(
stabs_symbol
),
stNil
,
scInfo
,
-
1
,
MIPS_MARK_STAB
(
0
));
}
/* Read code from stabs. */
/* Read code from stabs. */
if
(
!
isdigit
(
*
rest
))
if
(
!
isdigit
(
*
rest
))
...
@@ -3691,12 +3707,10 @@ parse_stabs_common (string_start, string_end, rest)
...
@@ -3691,12 +3707,10 @@ parse_stabs_common (string_start, string_end, rest)
}
}
else
else
{
{
code
=
MIPS_MARK_STAB
(
code
);
/* Skip ,0,0, */
/* Skip ,0,0, */
if
(
p
[
0
]
!=
','
||
p
[
1
]
!=
'0'
||
p
[
2
]
!=
','
||
p
[
3
]
!=
'0'
||
p
[
4
]
!=
','
)
if
(
p
[
0
]
!=
','
||
p
[
1
]
!=
'0'
||
p
[
2
]
!=
','
||
p
[
3
]
!=
'0'
||
p
[
4
]
!=
','
)
{
{
error
(
"Illegal .stabs/.stabn directive, mand
i
tory 0 isn't"
);
error
(
"Illegal .stabs/.stabn directive, mand
a
tory 0 isn't"
);
return
;
return
;
}
}
...
@@ -3739,10 +3753,20 @@ parse_stabs_common (string_start, string_end, rest)
...
@@ -3739,10 +3753,20 @@ parse_stabs_common (string_start, string_end, rest)
return
;
return
;
}
}
st
=
(
st_t
)
sym_ptr
->
st
;
/* Traditionally, N_LBRAC and N_RBRAC are *not* relocated. */
if
(
code
==
(
int
)
N_LBRAC
||
code
==
(
int
)
N_RBRAC
)
{
sc
=
scNil
;
st
=
stNil
;
}
else
{
sc
=
(
sc_t
)
sym_ptr
->
sc
;
sc
=
(
sc_t
)
sym_ptr
->
sc
;
st
=
(
st_t
)
sym_ptr
->
st
;
}
value
=
sym_ptr
->
value
;
value
=
sym_ptr
->
value
;
}
}
code
=
MIPS_MARK_STAB
(
code
);
}
}
(
void
)
add_local_symbol
(
string_start
,
string_end
,
st
,
sc
,
value
,
code
);
(
void
)
add_local_symbol
(
string_start
,
string_end
,
st
,
sc
,
value
,
code
);
...
@@ -4807,7 +4831,6 @@ main (argc, argv)
...
@@ -4807,7 +4831,6 @@ main (argc, argv)
if
(
version
)
if
(
version
)
{
{
extern
char
*
version_string
;
fprintf
(
stderr
,
"mips-tfile version %s"
,
version_string
);
fprintf
(
stderr
,
"mips-tfile version %s"
,
version_string
);
#ifdef TARGET_VERSION
#ifdef TARGET_VERSION
TARGET_VERSION
;
TARGET_VERSION
;
...
@@ -4908,8 +4931,6 @@ STATIC void
...
@@ -4908,8 +4931,6 @@ STATIC void
catch_signal
(
signum
)
catch_signal
(
signum
)
int
signum
;
int
signum
;
{
{
extern
char
*
sys_siglist
[
NSIG
+
1
];
(
void
)
signal
(
signum
,
SIG_DFL
);
/* just in case... */
(
void
)
signal
(
signum
,
SIG_DFL
);
/* just in case... */
fatal
(
sys_siglist
[
signum
]);
fatal
(
sys_siglist
[
signum
]);
}
}
...
...
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