Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Initialized data: part of the flash image, then copied into RAM
# on start. The .data section in normal hosted C.
if segment == "relocate":
try:
demangled = parse_mangled_name(name)
kernel_initialized.append((demangled, addr, size, 0))
except cxxfilt.InvalidName:
kernel_initialized.append((name, addr, size, 0))
# Uninitialized data, stored in a zeroed RAM section. The
# .bss section in normal hosted C.
elif segment == "sram":
try:
demangled = parse_mangled_name(name)
kernel_uninitialized.append((demangled, addr, size, 0))
except cxxfilt.InvalidName:
kernel_uninitialized.append((name, addr, size, 0))
# Code and embedded data.
elif segment == "text":
# pylint: disable=anomalous-backslash-in-string
match = re.search('\$(((\w+\.\.)+)(\w+))\$', name)
if match != None:
symbol = match.group(1)
symbol = symbol.replace('..', '::')
symbol = trim_hash_from_symbol(symbol)
kernel_functions.append((symbol, addr, size, 0))
else:
try:
symbol = parse_mangled_name(name)
kernel_functions.append((symbol, addr, size, 0))
except cxxfilt.InvalidName: