Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
d5329276
Commit
d5329276
authored
Oct 21, 2014
by
Reinhard Max
Committed by
Henrik Nordstrom
Oct 28, 2014
Browse files
Allow empty sections as found in the FEX files of Ippo q8h v1.2 and FSL S8
Signed-off-by:
Henrik Nordstrom
<
henrik@henriknordstrom.net
>
parent
dfece178
Changes
1
Hide whitespace changes
Inline
Side-by-side
script_bin.c
View file @
d5329276
...
...
@@ -82,10 +82,8 @@ size_t script_bin_size(struct script *script,
}
words
+=
WORDS
(
size
);
}
if
(
c
>
0
)
{
*
sections
+=
1
;
*
entries
+=
c
;
}
*
sections
+=
1
;
*
entries
+=
c
;
}
bin_size
=
sizeof
(
struct
script_bin_head
)
+
...
...
@@ -133,9 +131,6 @@ int script_generate_bin(void *bin, size_t UNUSED(bin_size),
size_t
c
=
0
;
s
=
container_of
(
ls
,
struct
script_section
,
sections
);
/* skip empty sections */
if
(
list_empty
(
&
s
->
entries
))
continue
;
memcpy
(
section
->
name
,
s
->
name
,
strlen
(
s
->
name
));
section
->
offset
=
((
void
*
)
entry
-
bin
)
>>
2
;
...
...
@@ -227,7 +222,7 @@ static int decompile_section(void *bin, size_t bin_size,
size
=
bin_size
-
4
*
section
->
offset
;
if
((
section
->
length
<
=
0
)
||
if
((
section
->
length
<
0
)
||
(
section
->
length
>
(
size
/
(
int
)
sizeof
(
struct
script_bin_entry
))))
{
pr_err
(
"Malformed data: invalid section length: %d
\n
"
,
section
->
length
);
...
...
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