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
28aaf32b
Commit
28aaf32b
authored
Feb 23, 1995
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SunOS 4 code
From-SVN: r9041
parent
49be3a59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
gcc/collect2.c
+43
-2
No files found.
gcc/collect2.c
View file @
28aaf32b
...
@@ -1839,6 +1839,7 @@ scan_prog_file (prog_name, which_pass)
...
@@ -1839,6 +1839,7 @@ scan_prog_file (prog_name, which_pass)
#include <sys/mman.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/param.h>
#include <sys/unistd.h>
#include <sys/unistd.h>
#include <sys/dir.h>
/* pointers to the object file */
/* pointers to the object file */
unsigned
object
;
/* address of memory mapped file */
unsigned
object
;
/* address of memory mapped file */
...
@@ -1872,6 +1873,43 @@ mapfile (name)
...
@@ -1872,6 +1873,43 @@ mapfile (name)
close
(
fp
);
close
(
fp
);
}
}
/* Helpers for locatelib. */
static
char
*
libname
;
static
int
libselect
(
d
)
struct
direct
*
d
;
{
return
(
strncmp
(
libname
,
d
->
d_name
,
strlen
(
libname
))
==
0
);
}
static
int
libcompare
(
d1
,
d2
)
struct
direct
**
d1
,
**
d2
;
{
int
i1
,
i2
=
strlen
(
libname
);
char
*
e1
=
(
*
d1
)
->
d_name
+
i2
;
char
*
e2
=
(
*
d2
)
->
d_name
+
i2
;
while
(
*
e1
&&
*
e2
)
{
++
e1
;
++
e2
;
i1
=
strtol
(
e1
,
&
e1
,
10
);
i2
=
strtol
(
e2
,
&
e2
,
10
);
if
(
i1
!=
i2
)
return
i1
-
i2
;
}
if
(
*
e1
)
return
1
;
else
if
(
*
e2
)
return
-
1
;
else
return
0
;
}
/* Given the name NAME of a dynamic dependency, find its pathname and add
/* Given the name NAME of a dynamic dependency, find its pathname and add
it to the list of libraries. */
it to the list of libraries. */
...
@@ -1941,11 +1979,14 @@ locatelib (name)
...
@@ -1941,11 +1979,14 @@ locatelib (name)
*
pp
++
=
"/usr/local/lib"
;
*
pp
++
=
"/usr/local/lib"
;
*
pp
=
0
;
*
pp
=
0
;
}
}
libname
=
name
;
for
(
pp
=
l
;
*
pp
!=
0
;
pp
++
)
for
(
pp
=
l
;
*
pp
!=
0
;
pp
++
)
{
{
sprintf
(
buf
,
"%s/%s"
,
*
pp
,
name
);
struct
direct
**
namelist
;
if
(
access
(
buf
,
R_OK
)
==
0
)
int
entries
;
if
((
entries
=
scandir
(
*
pp
,
&
namelist
,
libselect
,
libcompare
))
>
0
)
{
{
sprintf
(
buf
,
"%s/%s"
,
*
pp
,
namelist
[
entries
-
1
]
->
d_name
);
add_to_list
(
&
libraries
,
buf
);
add_to_list
(
&
libraries
,
buf
);
if
(
debug
)
if
(
debug
)
fprintf
(
stderr
,
"%s
\n
"
,
buf
);
fprintf
(
stderr
,
"%s
\n
"
,
buf
);
...
...
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