[PATCH] D114749: [JITLink][ELF] Don't skip sections of size 0
Steven Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 30 09:19:28 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc737d4d20321: [JITLink][ELF] Don't skip sections of size 0 (authored by steven_wu).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114749/new/
https://reviews.llvm.org/D114749
Files:
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
llvm/test/ExecutionEngine/JITLink/X86/ELF_empty_section.s
Index: llvm/test/ExecutionEngine/JITLink/X86/ELF_empty_section.s
===================================================================
--- /dev/null
+++ llvm/test/ExecutionEngine/JITLink/X86/ELF_empty_section.s
@@ -0,0 +1,12 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t
+// RUN: llvm-jitlink -noexec %t
+
+.section .foo,"ax"
+.globl zero
+zero:
+
+
+.text
+.globl main
+main:
+nop
Index: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
+++ llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
@@ -316,11 +316,6 @@
else
Prot = MemProt::Read | MemProt::Write;
- // For now we just use this to skip the "undefined" section, probably need
- // to revist.
- if (Sec.sh_size == 0)
- continue;
-
auto &GraphSec = G->createSection(*Name, Prot);
if (Sec.sh_type != ELF::SHT_NOBITS) {
auto Data = Obj.template getSectionContentsAsArray<char>(Sec);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114749.390740.patch
Type: text/x-patch
Size: 1044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211130/2f5cba83/attachment.bin>
More information about the llvm-commits
mailing list