fix(ldgen): extend section name regex to include '_' (e.g.: used by picolibc)

This commit is contained in:
Alexey Lapshin
2024-09-26 13:15:36 +07:00
committed by Tan Yan Quan
parent 5e38aaeb22
commit 6ad902d5be

View File

@ -1,16 +1,26 @@
# #
# SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD # SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
import collections import collections
import fnmatch import fnmatch
import os import os
from enum import Enum from enum import Enum
from functools import total_ordering from functools import total_ordering
from pyparsing import (Group, Literal, OneOrMore, ParseException, Regex, SkipTo, Suppress, White, Word, ZeroOrMore, from pyparsing import alphas
alphas, nums, rest_of_line) from pyparsing import Group
from pyparsing import Literal
from pyparsing import nums
from pyparsing import OneOrMore
from pyparsing import ParseException
from pyparsing import Regex
from pyparsing import rest_of_line
from pyparsing import SkipTo
from pyparsing import Suppress
from pyparsing import White
from pyparsing import Word
from pyparsing import ZeroOrMore
@total_ordering @total_ordering
@ -140,7 +150,7 @@ class EntityDB:
# 00 {section} 0000000 ... # 00 {section} 0000000 ...
# CONTENTS, ALLOC, .... # CONTENTS, ALLOC, ....
section_entry = (Suppress(Word(nums)) + Regex(r'\.\S+') + Suppress(rest_of_line) section_entry = (Suppress(Word(nums)) + Regex(r'\.\S+') + Suppress(rest_of_line)
+ Suppress(ZeroOrMore(Word(alphas) + Literal(',')) + Word(alphas))) + Suppress(ZeroOrMore(Word(alphas + '_') + Literal(',')) + Word(alphas + '_')))
content = Group(object_line content = Group(object_line
+ section_start + section_start