diff --git a/builder/sizes.go b/builder/sizes.go index 35622f1b..2e03adf2 100644 --- a/builder/sizes.go +++ b/builder/sizes.go @@ -371,7 +371,7 @@ func loadProgramSize(path string, packagePathMap map[string]string) (*programSiz if section.Flags&elf.SHF_ALLOC == 0 { continue } - if packageSymbolRegexp.MatchString(symbol.Name) { + if packageSymbolRegexp.MatchString(symbol.Name) || symbol.Name == "__isr_vector" { addresses = append(addresses, addressLine{ Address: symbol.Value, Length: symbol.Size, @@ -834,6 +834,8 @@ func findPackagePath(path string, packagePathMap map[string]string) string { } else if packageSymbolRegexp.MatchString(path) { // Parse symbol names like main$alloc or runtime$string. packagePath = path[:strings.LastIndex(path, "$")] + } else if path == "__isr_vector" { + packagePath = "C interrupt vector" } else if path == "" { packagePath = "Go types" } else if path == "" { diff --git a/targets/cortex-m-qemu.s b/targets/cortex-m-qemu.s index fdbecc8f..685c7fd5 100644 --- a/targets/cortex-m-qemu.s +++ b/targets/cortex-m-qemu.s @@ -23,6 +23,7 @@ Default_Handler: .section .isr_vector, "a", %progbits .global __isr_vector +__isr_vector: // 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 // _stack_top and Reset_Handler. @@ -54,3 +55,5 @@ Default_Handler: IRQ DebugMon_Handler IRQ PendSV_Handler IRQ SysTick_Handler + +.size __isr_vector, .-__isr_vector diff --git a/tools/gen-device-svd/gen-device-svd.go b/tools/gen-device-svd/gen-device-svd.go index 087a6622..8eb308c7 100755 --- a/tools/gen-device-svd/gen-device-svd.go +++ b/tools/gen-device-svd/gen-device-svd.go @@ -1422,6 +1422,9 @@ __isr_vector: for _, intr := range device.Interrupts { fmt.Fprintf(w, " IRQ %s_IRQHandler\n", intr.Name) } + w.WriteString(` +.size __isr_vector, .-__isr_vector +`) return w.Flush() }