Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mkcl
mkcl
Commits
64b38253
Commit
64b38253
authored
May 25, 2020
by
Jean-Claude Beaudoin
Browse files
Remove through conditional compilation some code that dit not make sense outside i836 or x86_64.
parent
efb7aa9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/tinycc/mkccelf.c
View file @
64b38253
...
...
@@ -996,32 +996,34 @@ static void relocate_rel(MKCCState *s1, Section *sr)
their space */
static
int
prepare_dynamic_rel
(
MKCCState
*
s1
,
Section
*
sr
)
{
int
count
=
0
;
#if defined(MKCC_TARGET_I386) || defined(MKCC_TARGET_X86_64)
/* JCB */
ElfW_Rel
*
rel
;
int
sym_index
,
esym_index
,
type
,
count
;
count
=
0
;
for_each_elem
(
sr
,
0
,
rel
,
ElfW_Rel
)
{
sym_index
=
ELFW
(
R_SYM
)(
rel
->
r_info
);
type
=
ELFW
(
R_TYPE
)(
rel
->
r_info
);
int
sym_index
=
ELFW
(
R_SYM
)(
rel
->
r_info
);
int
type
=
ELFW
(
R_TYPE
)(
rel
->
r_info
);
switch
(
type
)
{
#if defined(MKCC_TARGET_I386)
#
if defined(MKCC_TARGET_I386)
case
R_386_32
:
#elif defined(MKCC_TARGET_X86_64)
#
elif defined(MKCC_TARGET_X86_64)
case
R_X86_64_32
:
case
R_X86_64_32S
:
case
R_X86_64_64
:
#endif
#
endif
count
++
;
break
;
#if defined(MKCC_TARGET_I386)
#
if defined(MKCC_TARGET_I386)
case
R_386_PC32
:
#elif defined(MKCC_TARGET_X86_64)
#
elif defined(MKCC_TARGET_X86_64)
case
R_X86_64_PC32
:
#endif
esym_index
=
s1
->
symtab_to_dynsym
[
sym_index
];
if
(
esym_index
)
# endif
{
int
esym_index
=
s1
->
symtab_to_dynsym
[
sym_index
];
if
(
esym_index
)
count
++
;
break
;
}
break
;
default:
break
;
}
...
...
@@ -1031,6 +1033,7 @@ static int prepare_dynamic_rel(MKCCState *s1, Section *sr)
sr
->
sh_flags
|=
SHF_ALLOC
;
sr
->
sh_size
=
count
*
sizeof
(
ElfW_Rel
);
}
#endif
/* defined(MKCC_TARGET_I386) || defined(MKCC_TARGET_X86_64) */
return
count
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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