builder: sizes: list interrupt vector as a pseudo-package for -size=full
This is another bit of memory that is now correctly accounted for in `-size=full`.
Этот коммит содержится в:
родитель
de281191e0
коммит
ea97c60959
3 изменённых файлов: 9 добавлений и 1 удалений
|
@ -371,7 +371,7 @@ func loadProgramSize(path string, packagePathMap map[string]string) (*programSiz
|
||||||
if section.Flags&elf.SHF_ALLOC == 0 {
|
if section.Flags&elf.SHF_ALLOC == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if packageSymbolRegexp.MatchString(symbol.Name) {
|
if packageSymbolRegexp.MatchString(symbol.Name) || symbol.Name == "__isr_vector" {
|
||||||
addresses = append(addresses, addressLine{
|
addresses = append(addresses, addressLine{
|
||||||
Address: symbol.Value,
|
Address: symbol.Value,
|
||||||
Length: symbol.Size,
|
Length: symbol.Size,
|
||||||
|
@ -834,6 +834,8 @@ func findPackagePath(path string, packagePathMap map[string]string) string {
|
||||||
} else if packageSymbolRegexp.MatchString(path) {
|
} else if packageSymbolRegexp.MatchString(path) {
|
||||||
// Parse symbol names like main$alloc or runtime$string.
|
// Parse symbol names like main$alloc or runtime$string.
|
||||||
packagePath = path[:strings.LastIndex(path, "$")]
|
packagePath = path[:strings.LastIndex(path, "$")]
|
||||||
|
} else if path == "__isr_vector" {
|
||||||
|
packagePath = "C interrupt vector"
|
||||||
} else if path == "<Go type>" {
|
} else if path == "<Go type>" {
|
||||||
packagePath = "Go types"
|
packagePath = "Go types"
|
||||||
} else if path == "<Go interface assert>" {
|
} else if path == "<Go interface assert>" {
|
||||||
|
|
|
@ -23,6 +23,7 @@ Default_Handler:
|
||||||
|
|
||||||
.section .isr_vector, "a", %progbits
|
.section .isr_vector, "a", %progbits
|
||||||
.global __isr_vector
|
.global __isr_vector
|
||||||
|
__isr_vector:
|
||||||
// Interrupt vector as defined by Cortex-M, starting with the stack top.
|
// Interrupt vector as defined by Cortex-M, starting with the stack top.
|
||||||
// On reset, SP is initialized with *0x0 and PC is loaded with *0x4, loading
|
// On reset, SP is initialized with *0x0 and PC is loaded with *0x4, loading
|
||||||
// _stack_top and Reset_Handler.
|
// _stack_top and Reset_Handler.
|
||||||
|
@ -54,3 +55,5 @@ Default_Handler:
|
||||||
IRQ DebugMon_Handler
|
IRQ DebugMon_Handler
|
||||||
IRQ PendSV_Handler
|
IRQ PendSV_Handler
|
||||||
IRQ SysTick_Handler
|
IRQ SysTick_Handler
|
||||||
|
|
||||||
|
.size __isr_vector, .-__isr_vector
|
||||||
|
|
|
@ -1422,6 +1422,9 @@ __isr_vector:
|
||||||
for _, intr := range device.Interrupts {
|
for _, intr := range device.Interrupts {
|
||||||
fmt.Fprintf(w, " IRQ %s_IRQHandler\n", intr.Name)
|
fmt.Fprintf(w, " IRQ %s_IRQHandler\n", intr.Name)
|
||||||
}
|
}
|
||||||
|
w.WriteString(`
|
||||||
|
.size __isr_vector, .-__isr_vector
|
||||||
|
`)
|
||||||
return w.Flush()
|
return w.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче