Open I-mikan-I opened 4 months ago
addressed in ace099eefb4fcc
There are some issues i see with the new approach:
-rdynamic/-Wl,--export-dynamic
, which exports all symbols-lm
Perhaps it would be a better idea to compile each benchmark as a shared library with -nostartupfiles -nostdlib -c
?
I'm not sure that shared libraries help if you are going to compile down for a small embedded device.
One option is to use attributes to force particular functions and symbols to be retained. Would adding __attribute__ ((noinline)) __attribute__ ((externally_visible))
to the declaration of the relevant functions do the trick?
I'm not sure that shared libraries help if you are going to compile down for a small embedded device.
It wouldn't be possible to run them as dylibs, i just thought if you compile them as such, you remove any libraries and startup files from the elf/macho and can get an accurate size measurement for the code size. If we want to run the same file that we measured the size of then this isn't viable.
One option is to use attributes to force particular functions and symbols to be retained. Would adding
__attribute__ ((noinline)) __attribute__ ((externally_visible))
to the declaration of the relevant functions do the trick?
Thanks, I'll try this attribute. This should improve --export-dynamic by also preventing inlining.
I compared the results of either using __attribute__ ((noinline)) __attribute__ ((externally_visible))
, or using -Wl,--export-all
.
The --export-all
variant seems to be more accurate: for tarfind it reports a size of 265 bytes, the actual size of the benchmark_body
code being 260 bytes.
I thought it was previously discussed that embench was moving away from library subtraction in part because of issues like the ones you’ve raised, did this now change?
We try to subtract the size overhead for libraries, startup files, crt when calculating the size of benchmarks. Currently this is done as follows:
Issues with the current approach
New approach (planned for embench-iot 2.0)