Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ppe42-binutils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenPOWER Firmware
ppe42-binutils
Commits
8d8385cf
Commit
8d8385cf
authored
Aug 01, 2011
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2011-08-01 Tristan Gingold <gingold@adacore.com>
* frags.c (frag_grow): Simplify the code.
parent
d2421a70
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
18 deletions
+29
-18
gas/ChangeLog
gas/ChangeLog
+4
-0
gas/frags.c
gas/frags.c
+25
-18
No files found.
gas/ChangeLog
View file @
8d8385cf
2011-08-01 Tristan Gingold <gingold@adacore.com>
* frags.c (frag_grow): Simplify the code.
2011-07-30 Richard Sandiford <rdsandiford@googlemail.com>
* config/tc-mips.c (nops_for_vr4130): Revert previous commit.
...
...
gas/frags.c
View file @
8d8385cf
...
...
@@ -85,31 +85,38 @@ frag_grow (unsigned int nchars)
{
if
(
obstack_room
(
&
frchain_now
->
frch_obstack
)
<
nchars
)
{
unsigned
int
n
;
long
oldc
;
long
newc
;
frag_wane
(
frag_now
);
frag_new
(
0
);
oldc
=
frchain_now
->
frch_obstack
.
chunk_size
;
/* Try to allocate a bit more than needed right now. But don't do
this if we would waste too much memory. Especially necessary
for extremely big (like 2GB initialized) frags. */
if
(
nchars
<
0x10000
)
frchain_now
->
frch_obstack
.
chunk_size
=
2
*
nchars
;
newc
=
2
*
nchars
;
else
frchain_now
->
frch_obstack
.
chunk_size
=
nchars
+
0x10000
;
frchain_now
->
frch_obstack
.
chunk_size
+=
SIZEOF_STRUCT_FRAG
;
if
(
frchain_now
->
frch_obstack
.
chunk_size
>
0
)
while
((
n
=
obstack_room
(
&
frchain_now
->
frch_obstack
))
<
nchars
&&
(
unsigned
long
)
frchain_now
->
frch_obstack
.
chunk_size
>
nchars
)
newc
=
nchars
+
0x10000
;
newc
+=
SIZEOF_STRUCT_FRAG
;
/* Check for possible overflow. */
if
(
newc
<
0
)
as_fatal
(
_
(
"can't extend frag %u chars"
),
nchars
);
/* Force to allocate at least NEWC bytes. */
oldc
=
obstack_chunk_size
(
&
frchain_now
->
frch_obstack
);
obstack_chunk_size
(
&
frchain_now
->
frch_obstack
)
=
newc
;
while
(
obstack_room
(
&
frchain_now
->
frch_obstack
)
<
nchars
)
{
/* Not enough room in this frag. Close it and start a new one.
This must be done in a loop because the created frag may not
be big enough if the current obstack chunk is used. */
frag_wane
(
frag_now
);
frag_new
(
0
);
}
frchain_now
->
frch_obstack
.
chunk_size
=
oldc
;
/* Restore the old chunk size. */
obstack_chunk_size
(
&
frchain_now
->
frch_obstack
)
=
oldc
;
}
if
(
obstack_room
(
&
frchain_now
->
frch_obstack
)
<
nchars
)
as_fatal
(
_
(
"can't extend frag %u chars"
),
nchars
);
}
/* Call this to close off a completed frag, and start up a new (empty)
...
...
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