mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
compiler: add minsize attribute for -Oz
This matches the behavior of Clang, which uses optsize for -Os and adds minsize for -Oz. The code size change is all over the map, but using a hacked together size comparison tool I've found that there is a slight reduction in binary size overall (-1.6% with the tinygo smoke tests and -0.8% for the drivers smoke test).
This commit is contained in:
committed by
Ron Evans
parent
d7b7583e83
commit
7c24925aa7
@@ -180,8 +180,8 @@ func CallGraph(f *elf.File, callsIndirectFunction []string) (map[string][]*CallN
|
||||
// used for getting a function pointer
|
||||
isCall = false
|
||||
case elf.R_ARM_ABS32:
|
||||
// used in the reset vector for pointers
|
||||
isCall = false
|
||||
// when compiling with -Oz (minsize), used for calling
|
||||
isCall = true
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown relocation: %s", relocType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user