Skip to content

Commit 13d376f

Browse files
igcbotpetechou
andauthored
ZEBIN kernel _entry symbol update. (#15834)
_entry symbol with nonzero size is a nested function because it is within the kernel symbol range. The implementation may cause some problems for debugger. Updated the implementation to make _entry symbol more like a label by changing its type to STT_NOTYPE and its size to 0. Co-authored-by: Pete Chou <[email protected]>
1 parent fa1e873 commit 13d376f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6595,9 +6595,8 @@ namespace IGC
65956595
std::max(std::max(jitInfo->offsetToSkipPerThreadDataLoad,
65966596
jitInfo->offsetToSkipCrossThreadDataLoad),
65976597
jitInfo->offsetToSkipSetFFIDGP1);
6598-
CreateLocalSymbol("_entry", vISA::GenSymType::S_FUNC, actual_kernel_start_off,
6599-
(unsigned)pMainKernel.getGenSize() - actual_kernel_start_off,
6600-
pOutput->m_symbols);
6598+
CreateLocalSymbol("_entry", vISA::GenSymType::S_NOTYPE,
6599+
actual_kernel_start_off, 0, pOutput->m_symbols);
66016600

66026601
// Create local function symbols for direct stackcall functions.
66036602
for (auto &stackFunc : stackFuncMap) {

IGC/ZEBinWriter/zebin/spec/elf.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ enum GenRelocType {
202202
In ZEBinary file for each kernel there is a corresponding ELF symbol with the
203203
same name as the kernel emitted in the .symtab. The kernel symbol is local and
204204
points to offset 0 of the section. Currently for each kernel a local symbol
205-
"_entry" is emitted to represent the actul kernel start. A kernel may start
206-
with some prolog code and it is useful to know the actual kernel start offset
207-
in some cases.
205+
"_entry" is emitted to represent the actual kernel start, and the symbol type is
206+
STT_NOTYPE and the size is 0. A kernel may start with some prolog code and it
207+
is useful to know the actual kernel start offset in some cases.

0 commit comments

Comments
 (0)