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
5db525e4
Commit
5db525e4
authored
Sep 17, 2014
by
Samuel Bronson
Committed by
Paul Eggert
Sep 17, 2014
Browse files
* unexmacosx.c (copy_data_segment): Port to GCC 4.6+.
Fixes: debbugs:9927
parent
9356a872
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
src/ChangeLog
src/ChangeLog
+4
-0
src/unexmacosx.c
src/unexmacosx.c
+22
-0
No files found.
src/ChangeLog
View file @
5db525e4
2014-09-17 Samuel Bronson <naesten@gmail.com>
* unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).
2014-09-17 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problems found by static checking.
...
...
src/unexmacosx.c
View file @
5db525e4
...
...
@@ -879,6 +879,27 @@ copy_data_segment (struct load_command *lc)
if
(
!
unexec_write
(
header_offset
,
sectp
,
sizeof
(
struct
section
)))
unexec_error
(
"cannot write section %.16s's header"
,
sectp
->
sectname
);
}
else
if
(
strncmp
(
sectp
->
sectname
,
"__bss"
,
5
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__pu_bss"
,
8
)
==
0
)
{
sectp
->
flags
=
S_REGULAR
;
/* These sections are produced by GCC 4.6+.
FIXME: We possibly ought to clear uninitialized local
variables in statically linked libraries like for
SECT_BSS (__bss) above, but setting up the markers we
need in lastfile.c would be rather messy. See
darwin_output_aligned_bss () in gcc/config/darwin.c for
the root of the problem, keeping in mind that the
sections are numbered by their alignment in GCC 4.6, but
by log2(alignment) in GCC 4.7. */
if
(
!
unexec_write
(
sectp
->
offset
,
(
void
*
)
sectp
->
addr
,
sectp
->
size
))
unexec_error
(
"cannot copy section %.16s"
,
sectp
->
sectname
);
if
(
!
unexec_write
(
header_offset
,
sectp
,
sizeof
(
struct
section
)))
unexec_error
(
"cannot write section %.16s's header"
,
sectp
->
sectname
);
}
else
if
(
strncmp
(
sectp
->
sectname
,
"__la_symbol_ptr"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__nl_symbol_ptr"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__got"
,
16
)
==
0
...
...
@@ -890,6 +911,7 @@ copy_data_segment (struct load_command *lc)
||
strncmp
(
sectp
->
sectname
,
"__program_vars"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__mod_init_func"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__mod_term_func"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__static_data"
,
16
)
==
0
||
strncmp
(
sectp
->
sectname
,
"__objc_"
,
7
)
==
0
)
{
if
(
!
unexec_copy
(
sectp
->
offset
,
old_file_offset
,
sectp
->
size
))
...
...
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