Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ecpcitest
proteas
llvm-project
Commits
fdb65785
Commit
fdb65785
authored
Jan 22, 2022
by
luxufan
Browse files
Revert "[JITLink] Add anonymous symbols in LinkGraph for unnamed temporary symbols"
This reverts commit
de872382
. Buildbot check error
parent
de872382
Changes
5
Hide whitespace changes
Inline
Side-by-side
llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
View file @
fdb65785
...
...
@@ -79,12 +79,6 @@ enum EdgeKind_riscv : Edge::Kind {
/// Fixup <- (Target - Fixup + Addend)
R_RISCV_CALL
,
/// 32 bits PC relative relocation
///
/// Fixup expression:
/// Fixup <- (Target - Fixup + Addend)
R_RISCV_32_PCREL
,
/// PC relative GOT offset
///
/// Fixup expression:
...
...
@@ -143,7 +137,7 @@ enum EdgeKind_riscv : Edge::Kind {
///
/// Fixup expression
/// Fixup <- (Target - *{1}Fixup - Addend)
R_RISCV_SUB8
,
R_RISCV_SUB8
};
/// Returns a string name for the given riscv edge. For debugging purposes
...
...
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
View file @
fdb65785
...
...
@@ -441,15 +441,11 @@ template <typename ELFT> Error ELFLinkGraphBuilder<ELFT>::graphifySymbols() {
<<
"
\"\n
"
;
});
// In RISCV, temporary symbols (Used to generate dwarf, eh_frame
// sections...) will appear in object code's symbol table, and LLVM does
// not use names on these temporary symbols (RISCV gnu toolchain uses
// names on these temporary symbols). If the symbol is unnamed, add an
// anonymous symbol.
// Model the section symbols as anonymous symbol.
auto
&
GSym
=
Name
->
empty
()
?
G
->
addAnonymousSymbol
(
*
B
,
Sym
.
getValue
(),
Sym
.
st_size
,
false
,
false
)
Sym
.
getType
()
==
ELF
::
STT_SECTION
?
G
->
addAnonymousSymbol
(
*
B
,
Sym
.
getValue
(),
Sym
.
st_size
,
false
,
false
)
:
G
->
addDefinedSymbol
(
*
B
,
Sym
.
getValue
(),
*
Name
,
Sym
.
st_size
,
L
,
S
,
Sym
.
getType
()
==
ELF
::
STT_FUNC
,
false
);
setGraphSymbol
(
SymIndex
,
GSym
);
...
...
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
View file @
fdb65785
...
...
@@ -359,12 +359,6 @@ private:
*
FixupPtr
=
static_cast
<
uint8_t
>
(
Value
);
break
;
}
case
R_RISCV_32_PCREL
:
{
// FIXME: It seems that R_RISCV_32_PCREL relocation will only appear in debug sections
// like eh_frame section. Currently, because of eh_frame will not be processed in JITLink's RISCV
// backend, test this relocation is difficult, so here report error if needs to fixup this relocation
return
make_error
<
JITLinkError
>
(
"Fixup of relocation type R_RISCV_32_PCREL is not supportted"
);
}
}
return
Error
::
success
();
}
...
...
@@ -415,8 +409,6 @@ private:
return
EdgeKind_riscv
::
R_RISCV_SUB16
;
case
ELF
::
R_RISCV_SUB8
:
return
EdgeKind_riscv
::
R_RISCV_SUB8
;
case
ELF
::
R_RISCV_32_PCREL
:
return
EdgeKind_riscv
::
R_RISCV_32_PCREL
;
}
return
make_error
<
JITLinkError
>
(
"Unsupported riscv relocation:"
+
...
...
llvm/lib/ExecutionEngine/JITLink/riscv.cpp
View file @
fdb65785
...
...
@@ -38,8 +38,6 @@ const char *getEdgeKindName(Edge::Kind K) {
return
"R_RISCV_PCREL_LO12_S"
;
case
R_RISCV_CALL
:
return
"R_RISCV_CALL"
;
case
R_RISCV_32_PCREL
:
return
"R_RISCV_32_PCREL"
;
case
R_RISCV_ADD64
:
return
"R_RISCV_ADD64"
;
case
R_RISCV_ADD32
:
...
...
llvm/test/ExecutionEngine/JITLink/RISCV/anonymous_symbol.s
deleted
100644 → 0
View file @
de872382
#
RUN
:
llvm
-
mc
-
triple
=
riscv64
-
filetype
=
obj
-
o
%
t
%
s
#
RUN
:
llvm
-
jitlink
-
debug
-
only
=
jitlink
-
noexec
%
t
2
>
&1
|
FileCheck
%
s
#
#
Because
of
the
exist
of
cfi
directive
,
sections
like
eh_frame
section
will
be
emitted
#
in
llvm
's object code emission phase. Anonymous symbols will also be emitted to indicate
#
the
section
start
and
section
end
.
So
that
by
relocating
these
symbol
,
the
section
length
#
can
be
calculated
.
#
#
CHECK
:
Creating
defined
graph
symbol
for
ELF
symbol
""
#
CHECK
:
Creating
defined
graph
symbol
for
ELF
symbol
""
.
text
.
globl
main
.
p2align
2
.
type
main
,
@
function
main
:
.
cfi_startproc
ret
.
Lfunc_end0
:
.
size
main
,
.
Lfunc_end0
-
main
.
cfi_endproc
Denny, Joel
@jum
mentioned in commit
0283b077
·
Jan 22, 2022
mentioned in commit
0283b077
mentioned in commit 0283b07746e879961fd9361579e0da2a62430696
Toggle commit list
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