File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,11 @@ def get_section_ranges(elf):
207
207
ram_size = 0
208
208
unassigned_size = 0
209
209
210
+ xip = any (section .get_symbol_by_name ('CONFIG_XIP' )
211
+ for section in elf .iter_sections ('SHT_SYMTAB' ))
212
+ if args .verbose :
213
+ print (f'INFO: XIP={ xip } ' )
214
+
210
215
for section in elf .iter_sections ():
211
216
size = section ['sh_size' ]
212
217
sec_start = section ['sh_addr' ]
@@ -232,14 +237,16 @@ def get_section_ranges(elf):
232
237
print_section_info (section , "ROM txt section" )
233
238
234
239
elif (flags & SHF_WRITE_ALLOC ) == SHF_WRITE_ALLOC :
235
- # Data occupies both ROM and RAM
236
- # since at boot, content is copied from ROM to RAM
237
- rom_addr_ranges .append (bound )
238
- rom_size += size
240
+ # Read/write data
241
+ if xip :
242
+ # For XIP, the data section occupies both ROM and RAM
243
+ # since at boot, content is copied from ROM to RAM
244
+ rom_addr_ranges .append (bound )
245
+ rom_size += size
239
246
ram_addr_ranges .append (bound )
240
247
ram_size += size
241
248
is_assigned = True
242
- print_section_info (section , "ROM,RAM section" )
249
+ print_section_info (section , "DATA r/w section" )
243
250
244
251
elif (flags & SHF_ALLOC ) == SHF_ALLOC :
245
252
# Read only data
You can’t perform that action at this time.
0 commit comments