forked from M-Labs/artiq
1
0
Fork 0

compiler: generate symbols

This commit is contained in:
occheung 2021-08-17 11:44:05 +08:00
parent 1293e0750e
commit f77b607b56
3 changed files with 13 additions and 2 deletions

View File

@ -4,3 +4,4 @@ include artiq/gui/logo*.svg
include versioneer.py include versioneer.py
include artiq/_version.py include artiq/_version.py
include artiq/coredevice/coredevice_generic.schema.json include artiq/coredevice/coredevice_generic.schema.json
include artiq/compiler/kernel.ld

9
artiq/compiler/kernel.ld Normal file
View File

@ -0,0 +1,9 @@
SECTIONS {
.bss ALIGN(4) :
{
__bss_start = .;
*(.sbss .sbss.* .bss .bss.*);
. = ALIGN(4);
_end = .;
}
}

View File

@ -182,6 +182,7 @@ class Target:
def link(self, objects): def link(self, objects):
"""Link the relocatable objects into a shared library for this target.""" """Link the relocatable objects into a shared library for this target."""
with RunTool([self.tool_ld, "-shared", "--eh-frame-hdr"] + with RunTool([self.tool_ld, "-shared", "--eh-frame-hdr"] +
["-T" + os.path.join(os.path.dirname(__file__), "kernel.ld")] +
["{{obj{}}}".format(index) for index in range(len(objects))] + ["{{obj{}}}".format(index) for index in range(len(objects))] +
["-x"] + ["-x"] +
["-o", "{output}"], ["-o", "{output}"],
@ -258,9 +259,9 @@ class NativeTarget(Target):
class RISCVTarget(Target): class RISCVTarget(Target):
triple = "riscv32-unknown-linux" triple = "riscv32-unknown-linux"
data_layout = "e-m:e-p:32:32-i64:64-n32-S128" data_layout = "e-m:e-p:32:32-i64:64-n32-S128"
features = [] features = ["m", "a"]
print_function = "core_log" print_function = "core_log"
little_endian = False little_endian = True
now_pinning = True now_pinning = True
tool_ld = "ld.lld" tool_ld = "ld.lld"