Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
85b2e0ee
Commit
85b2e0ee
authored
Mar 13, 1995
by
Richard M. Stallman
Browse files
(unexec): Adjust the file offset of sections located
after the section header table.
parent
4c0b5ad1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
src/unexelf.c
src/unexelf.c
+13
-5
No files found.
src/unexelf.c
View file @
85b2e0ee
...
...
@@ -719,11 +719,19 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
NEW_SECTION_H
(
nn
).
sh_addralign
=
OLD_SECTION_H
(
nn
).
sh_addralign
;
NEW_SECTION_H
(
nn
).
sh_size
=
0
;
}
/* Any section that was original placed AFTER the bss section should now
be off by NEW_DATA2_SIZE. */
else
if
(
NEW_SECTION_H
(
nn
).
sh_offset
>=
new_data2_offset
)
NEW_SECTION_H
(
nn
).
sh_offset
+=
new_data2_size
;
else
{
/* Any section that was original placed AFTER the bss
section should now be off by NEW_DATA2_SIZE. */
if
(
NEW_SECTION_H
(
nn
).
sh_offset
>=
new_data2_offset
)
NEW_SECTION_H
(
nn
).
sh_offset
+=
new_data2_size
;
/* Any section that was originally placed after the section
header table should now be off by the size of one section
header table entry. */
if
(
NEW_SECTION_H
(
nn
).
sh_offset
>
new_file_h
->
e_shoff
)
NEW_SECTION_H
(
nn
).
sh_offset
+=
new_file_h
->
e_shentsize
;
}
/* If any section hdr refers to the section after the new .data
section, make it refer to next one because we have inserted
a new section in between. */
...
...
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