Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
smol
Commits
788135c6
Commit
788135c6
authored
Jun 23, 2019
by
PoroCYon
Committed by
PoroCYon
Aug 12, 2019
Browse files
add fix for gcc 9.1 in the makefile, don't accept LTO input files
parent
2f535bef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
788135c6
...
...
@@ -58,6 +58,12 @@ clean:
%/
:
@
mkdir
-vp
"
$@
"
ifneq
($(findstring (GCC) 9,$(shell $(CC) --version)),)
INCLINKOPT
:=
-flinker-output
=
nolto-rel
else
INCLINKOPT
:=
endif
.SECONDARY
:
$(OBJDIR)/%.lto.o
:
$(SRCDIR)/%.c $(OBJDIR)/
...
...
@@ -71,7 +77,7 @@ $(OBJDIR)/%.o: $(TESTDIR)/%.c $(OBJDIR)/
$(CC)
$(CFLAGS)
-c
"
$<
"
-o
"
$@
"
$(OBJDIR)/%.start.o
:
$(OBJDIR)/%.lto.o $(OBJDIR)/crt1.lto.o
$(CC)
$(LDFLAGS)
-r
-o
"
$@
"
$^
$(CC)
$(LDFLAGS)
-r
$(INCLINKOPT)
-o
"
$@
"
$^
$(OBJDIR)/symbols.%.asm
:
$(OBJDIR)/%.o
$(PYTHON3)
$(PYDIR)
/smol.py
$(SMOLFLAGS)
$(LIBS)
"
$<
"
"
$@
"
...
...
src/smolparse.py
View file @
788135c6
...
...
@@ -56,10 +56,16 @@ def get_needed_syms(readelf_bin, inpfiles):
relocs
=
build_reloc_typ_table
(
outrel
)
curfile
=
inpfiles
[
0
]
syms
=
set
({})
for
entry
in
output
.
decode
(
'utf-8'
).
splitlines
():
stuff
=
entry
.
split
()
if
len
(
stuff
)
<
2
:
continue
if
stuff
[
0
]
==
"File:"
:
curfile
=
stuff
[
1
]
if
len
(
stuff
)
<
8
:
continue
if
stuff
[
7
].
startswith
(
"__gnu_lto_"
):
# yikes, an LTO object
eprintf
(
"{} is an LTO object file, can't use this!"
.
format
(
curfile
))
exit
(
1
)
if
stuff
[
4
]
==
"GLOBAL"
and
stuff
[
6
]
==
"UND"
and
len
(
stuff
[
7
])
>
0
\
and
stuff
[
7
]
in
relocs
:
syms
.
add
((
stuff
[
7
],
relocs
[
stuff
[
7
]]))
...
...
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