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
a6efbece
Commit
a6efbece
authored
Sep 05, 2000
by
Bruce Korb
Committed by
Bruce Korb
Sep 05, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always read header files with poorly chosen sizes
From-SVN: r36163
parent
0bb06853
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
gcc/ChangeLog
+5
-0
gcc/fixinc/fixincl.c
+12
-2
No files found.
gcc/ChangeLog
View file @
a6efbece
2000-09-05 Bruce Korb <bkorb@gnu.org>
* gcc/fixinc/fixincl.c(load_file): always read header files
with sizes that are a multiple of the page size.
2000-09-05 Alexandre Oliva <aoliva@redhat.com>
2000-09-05 Alexandre Oliva <aoliva@redhat.com>
* gcse.c (hash_string_1): Add prototype.
* gcse.c (hash_string_1): Add prototype.
...
...
gcc/fixinc/fixincl.c
View file @
a6efbece
...
@@ -338,6 +338,10 @@ load_file ( fname )
...
@@ -338,6 +338,10 @@ load_file ( fname )
if
(
stbf
.
st_size
==
0
)
if
(
stbf
.
st_size
==
0
)
return
(
char
*
)
NULL
;
return
(
char
*
)
NULL
;
/* Make the data map size one larger than the file size for documentation
purposes. Truth is that there will be a following NUL character if
the file size is not a multiple of the page size. If it is a multiple,
then this adjustment sometimes fails anyway. */
data_map_size
=
stbf
.
st_size
+
1
;
data_map_size
=
stbf
.
st_size
+
1
;
data_map_fd
=
open
(
fname
,
O_RDONLY
);
data_map_fd
=
open
(
fname
,
O_RDONLY
);
ttl_data_size
+=
data_map_size
-
1
;
ttl_data_size
+=
data_map_size
-
1
;
...
@@ -352,8 +356,14 @@ load_file ( fname )
...
@@ -352,8 +356,14 @@ load_file ( fname )
#ifdef HAVE_MMAP_FILE
#ifdef HAVE_MMAP_FILE
curr_data_mapped
=
BOOL_TRUE
;
curr_data_mapped
=
BOOL_TRUE
;
res
=
(
char
*
)
mmap
((
void
*
)
NULL
,
data_map_size
,
PROT_READ
,
MAP_PRIVATE
,
data_map_fd
,
0
);
/* IF the file size is a multiple of the page size,
THEN sometimes you will seg fault trying to access a trailing byte */
if
((
stbf
.
st_size
&
(
PAGESIZE
-
1
))
==
0
)
res
=
(
char
*
)
BAD_ADDR
;
else
res
=
(
char
*
)
mmap
((
void
*
)
NULL
,
data_map_size
,
PROT_READ
,
MAP_PRIVATE
,
data_map_fd
,
0
);
if
(
res
==
(
char
*
)
BAD_ADDR
)
if
(
res
==
(
char
*
)
BAD_ADDR
)
{
{
curr_data_mapped
=
BOOL_FALSE
;
curr_data_mapped
=
BOOL_FALSE
;
...
...
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