]> granicus.if.org Git - esp-idf/commitdiff
ldgen: fix error on parsing archive from sections info
authorRenz Christian Bagaporo <renz@espressif.com>
Tue, 27 Nov 2018 02:50:51 +0000 (10:50 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Wed, 28 Nov 2018 06:14:54 +0000 (14:14 +0800)
tools/ldgen/generation.py

index f3ee5f2c882450701624a4b63a9ccdd2b5207de2..3dc14de63464e16923222ea751044451ab416574 100644 (file)
@@ -581,8 +581,6 @@ and names
 """
 class SectionsInfo(dict):
 
-    PATH = Optional("/") + ZeroOrMore(Regex(r"[^/.]+") + Literal("/"))
-
     __info = collections.namedtuple("__info", "filename content")
 
     def __init__(self):
@@ -591,8 +589,8 @@ class SectionsInfo(dict):
     def add_sections_info(self, sections_info_file):
         first_line = sections_info_file.readline()
 
-        archive = Literal("In archive").suppress() + SectionsInfo.PATH.suppress() + Fragment.ENTITY.setResultsName("archive") + Literal(":").suppress()
-        parser = archive
+        archive_path = Literal("In archive").suppress() + Regex(r"[^:]+").setResultsName("archive_path") + Literal(":").suppress()
+        parser = archive_path
 
         results = None
 
@@ -601,7 +599,8 @@ class SectionsInfo(dict):
         except ParseException as p:
             raise ParseException("File " + sections_info_file.name + " is not a valid sections info file. " + p.message)
 
-        self.sections[results.archive] = SectionsInfo.__info(sections_info_file.name, sections_info_file.read())
+        archive = os.path.basename(results.archive_path)
+        self.sections[archive] = SectionsInfo.__info(sections_info_file.name, sections_info_file.read())
 
     def _get_infos_from_file(self, info):
         # Object file line: '{object}:  file format elf32-xtensa-le'