<span style=" font-size:10pt;font-family:sans-serif">Hi Chris.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">You can clone
this repository:</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">
</span><a href=https://github.com/ttsiodras/EmbeddedCoverage><span style=" font-size:10pt;color:blue;font-family:sans-serif">https://github.com/ttsiodras/EmbeddedCoverage</span></a>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">...and then use
different build invocations to easily reproduce - like this:</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"><b>First, with
an older toolchain:</b></span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ /opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-v</span>
<br><span style=" font-size:10pt;font-family:Courier New">Using built-in
specs.</span>
<br><span style=" font-size:10pt;font-family:Courier New">COLLECT_GCC=_sparc-rtems4.11-gcc</span>
<br><span style=" font-size:10pt;font-family:Courier New">COLLECT_LTO_WRAPPER=/opt/rtems-4.11/libexec/gcc/sparc-rtems4.11/4.8.1/lto-wrapper</span>
<br><span style=" font-size:10pt;font-family:Courier New">Target: sparc-rtems4.11</span>
<br><span style=" font-size:10pt;font-family:Courier New">Configured with:
../gcc-4.8.1/configure --enable-threads -with-gnu-as --with-gnu-ld --with-newlib
--verbose --with-system-zlib --disable-nls --enable-version-specific-runtime-libs
--enable-languages=c,c++,ada --target=sparc-rtems4.11 --prefix=/opt/rtems-4.11
--with-gmp=/opt/rtems-4.11 --with-mpfr=/opt/rtems-4.11 --with-mpc=/opt/rtems-4.11</span>
<br><span style=" font-size:10pt;font-family:Courier New">Thread model:
rtems</span>
<br><span style=" font-size:10pt;font-family:Courier New">gcc version 4.8.1
(GCC)</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
PLATFORM=OAR RTEMS=/opt/rtems-4.11 FPU=1 COVERAGE=1 CROSS_PREFIX=sparc-rtems4.11
V=1 CPU=leon3</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/init.o
src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/my_main.o
src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/task1.o
src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/task2.o
src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/gcc.o
src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/gcov_hooks.o
src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.11/bin/sparc-rtems4.11-gcc
-g -o bin.debug.leon3.OAR/fputest objs.debug.leon3.OAR/init.o objs.debug.leon3.OAR/my_main.o
objs.debug.leon3.OAR/task1.o objs.debug.leon3.OAR/task2.o objs.debug.leon3.OAR/gcc.o
objs.debug.leon3.OAR/gcov_hooks.o -fprofile-arcs -ftest-coverage -B/opt/rtems-4.11/sparc-rtems4.11/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress</span>
<br><span style=" font-size:10pt;font-family:Courier New">Built debug version
at bin.debug.leon3.OAR/fputest</span>
<br><span style=" font-size:10pt;font-family:Courier New">Build done via
RTEMS at /opt/rtems-4.11/sparc-rtems4.11/leon3/lib for leon3.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">With the old toolchain,
CTOR_LIST contains this:</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ sparc-rtems4.11-objdump
-d -x -S ./bin.debug.leon3.OAR/fputest | grep -A6 '<__CTOR_LIST__>'</span>
<br><span style=" font-size:10pt;font-family:Courier New">4001d100 <__CTOR_LIST__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New">4001d100:
ff ff ff ff 40 00 13 ac 40 00 14 54 40 00 18 54
....@...@..T@..T</span>
<br><span style=" font-size:10pt;font-family:Courier New">4001d110:
40 00 1b 38 40 00 22 4c 40 00 25 c0
@..8@."L@.%.</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">4001d11c <__CTOR_END__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New">4001d11c:
00 00 00 00
....</span>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">...so the addresses
of the "coverage stubs" are indeed stored in __CTOR_LIST__.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"><b>Then, with
rtems 4.12:</b></span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
clean</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
PLATFORM=OAR RTEMS=/opt/rtems-4.12 FPU=1 COVERAGE=1 CROSS_PREFIX=sparc-rtems4.12
V=1 CPU=leon3</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/init.o
src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/my_main.o
src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/task1.o
src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/task2.o
src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/gcc.o
src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_leon3 -o objs.debug.leon3.OAR/gcov_hooks.o
src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
-g -o bin.debug.leon3.OAR/fputest objs.debug.leon3.OAR/init.o objs.debug.leon3.OAR/my_main.o
objs.debug.leon3.OAR/task1.o objs.debug.leon3.OAR/task2.o objs.debug.leon3.OAR/gcc.o
objs.debug.leon3.OAR/gcov_hooks.o -fprofile-arcs -ftest-coverage -B/opt/rtems-4.12/sparc-rtems4.12/leon3/lib
-specs bsp_specs -qrtems -mcpu=cypress</span>
<br><span style=" font-size:10pt;font-family:Courier New">Built debug version
at bin.debug.leon3.OAR/fputest</span>
<br><span style=" font-size:10pt;font-family:Courier New">Build done via
RTEMS at /opt/rtems-4.12/sparc-rtems4.12/leon3/lib for leon3.</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">ttsiod@rtems-builder
~/GitHub/EmbeddedCoverage</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ /opt/rtems-4.12/bin/sparc-rtems4.12-objdump
-d -x -S ./bin.debug.leon3.OAR/fputest | grep -A7 '<__CTOR_LIST__>'</span>
<br><span style=" font-size:10pt;font-family:Courier New">40024c20 <__CTOR_LIST__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New">40024c20:
ff ff ff ff
....</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">40024c24 <__CTOR_END__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New">40024c24:
00 00 00 00 40 00 14 60 40 00 15 24 40 00 19 cc
....@..`@..$@...</span>
<br><span style=" font-size:10pt;font-family:Courier New">40024c34:
40 00 1d 34 40 00 24 74 40 00 28 08
@..4@.$t@.(.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">The CTOR_LIST
is empty - the addresses of the coverage stubs are in __CTOR_END__ - they
are not read by </span><span style=" font-size:10pt;font-family:Courier New">do_global_ctors_aux
</span><span style=" font-size:10pt;font-family:sans-serif">(<i>see the
relevant code in the previous post</i>).</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"><b>Then with a
freshly built RTEMS5 from the mainline (RSB 703532cb04c6990fb21e97cb7347a16e9df11108-modified)</b></span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
clean</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
PLATFORM=OAR RTEMS=/opt/rtems-5.1-2018.02.05 FPU=1 COVERAGE=1 CROSS_PREFIX=sparc-rtems5
V=1 CPU=gr740</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/init.o
src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/my_main.o
src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/task1.o
src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/task2.o
src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/gcc.o
src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/gcov_hooks.o
src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-g -o bin.debug.gr740.OAR/fputest objs.debug.gr740.OAR/init.o objs.debug.gr740.OAR/my_main.o
objs.debug.gr740.OAR/task1.o objs.debug.gr740.OAR/task2.o objs.debug.gr740.OAR/gcc.o
objs.debug.gr740.OAR/gcov_hooks.o -fprofile-arcs -ftest-coverage -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress</span>
<br><span style=" font-size:10pt;font-family:Courier New">Built debug version
at bin.debug.gr740.OAR/fputest</span>
<br><span style=" font-size:10pt;font-family:Courier New">Build done via
RTEMS at /opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib for gr740.</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">ttsiod@rtems-builder
~/GitHub/EmbeddedCoverage</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ /opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-objdump
-d -x -S ./bin.debug.gr740.OAR/fputest | grep -A7 '<__CTOR_LIST__>'</span>
<br><span style=" font-size:10pt;font-family:Courier New">000242c0 <__CTOR_LIST__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242c0:
ff ff ff ff
....</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">000242c4 <__CTOR_END__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242c4:
00 00 00 00 00 00 14 60 00 00 15 24 00 00 19 cc
.......`...$....</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242d4:
00 00 1d 34 00 00 24 74 00 00 28 08
...4..$t..(.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"><b>But if we patch
linkcmds.base like this...</b></span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br><span style=" font-size:10pt;font-family:Courier New">root@rtems-builder:/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib#
diff -u linkcmds.base.old linkcmds.base</span>
<br><span style=" font-size:10pt;font-family:Courier New">--- linkcmds.base.old
2018-02-28 09:51:46.984834147 +0100</span>
<br><span style=" font-size:10pt;font-family:Courier New">+++ linkcmds.base
2018-02-28 09:52:11.732833637 +0100</span>
<br><span style=" font-size:10pt;font-family:Courier New">@@ -89,11 +89,13
@@</span>
<br><span style=" font-size:10pt;font-family:Courier New">
The .ctor section from the crtend file contains the</span>
<br><span style=" font-size:10pt;font-family:Courier New">
end of ctors marker and it must be last */</span>
<br><span style=" font-size:10pt;font-family:Courier New">
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))</span>
<br><span style=" font-size:10pt;font-family:Courier New">- KEEP
(*(SORT(.ctors*)))</span>
<br><span style=" font-size:10pt;font-family:Courier New">+ KEEP
(*(SORT(.ctors.*)))</span>
<br><span style=" font-size:10pt;font-family:Courier New">+ KEEP
(*(.ctors))</span>
<br><span style=" font-size:10pt;font-family:Courier New">
KEEP (*crtbegin.o(.dtors))</span>
<br><span style=" font-size:10pt;font-family:Courier New">
KEEP (*crtbegin?.o(.dtors))</span>
<br><span style=" font-size:10pt;font-family:Courier New">
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))</span>
<br><span style=" font-size:10pt;font-family:Courier New">- KEEP
(*(SORT(.dtors*)))</span>
<br><span style=" font-size:10pt;font-family:Courier New">+ KEEP
(*(SORT(.dtors.*)))</span>
<br><span style=" font-size:10pt;font-family:Courier New">+ KEEP
(*(.dtors))</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">root@rtems-builder:/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib#
exit</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
clean</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ make
PLATFORM=OAR RTEMS=/opt/rtems-5.1-2018.02.05 FPU=1 COVERAGE=1 CROSS_PREFIX=sparc-rtems5
V=1 CPU=gr740</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">Generating dependencies
for src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/init.o
src/init.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/my_main.o
src/my_main.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/task1.o
src/task1.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/task2.o
src/task2.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/gcc.o
src/gcc.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-c -DCOVERAGE_ENABLED -fprofile-arcs -ftest-coverage -Wall -Wextra -g -I
src -DOAR -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes
-Wnested-externs -DDEBUG -O0 -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress -DBSP_gr740 -o objs.debug.gr740.OAR/gcov_hooks.o
src/gcov_hooks.c</span>
<br><span style=" font-size:10pt;font-family:Courier New">/opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-gcc
-g -o bin.debug.gr740.OAR/fputest objs.debug.gr740.OAR/init.o objs.debug.gr740.OAR/my_main.o
objs.debug.gr740.OAR/task1.o objs.debug.gr740.OAR/task2.o objs.debug.gr740.OAR/gcc.o
objs.debug.gr740.OAR/gcov_hooks.o -fprofile-arcs -ftest-coverage -B/opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib
-specs bsp_specs -qrtems -mcpu=cypress</span>
<br><span style=" font-size:10pt;font-family:Courier New">Built debug version
at bin.debug.gr740.OAR/fputest</span>
<br><span style=" font-size:10pt;font-family:Courier New">Build done via
RTEMS at /opt/rtems-5.1-2018.02.05/sparc-rtems5/gr740/lib for gr740.</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">ttsiod@rtems-builder
~/GitHub/EmbeddedCoverage</span>
<br><span style=" font-size:10pt;font-family:Courier New">(master)$ /opt/rtems-5.1-2018.02.05/bin/sparc-rtems5-objdump
-d -x -S ./bin.debug.gr740.OAR/fputest | grep -A7 '<__CTOR_LIST__>'</span>
<br><span style=" font-size:10pt;font-family:Courier New">000242c0 <__CTOR_LIST__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242c0:
ff ff ff ff 00 00 14 60 00 00 15 24 00 00 19 cc
.......`...$....</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242d0:
00 00 1d 34 00 00 24 74 00 00 28 08
...4..$t..(.</span>
<br>
<br><span style=" font-size:10pt;font-family:Courier New">000242dc <__CTOR_END__>:</span>
<br><span style=" font-size:10pt;font-family:Courier New"> 242dc:
00 00 00 00
....</span>
<br><span style=" font-size:10pt;font-family:sans-serif">=================================</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">...then the addresses
of the coverage stubs end up on the right list.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Hope this makes
things clearer,</span>
<br><span style=" font-size:10pt;font-family:sans-serif">Thanassis.</span>
<br>
<br>
<br><span style=" font-size:10pt;color:#000080;font-family:sans-serif"><b>Thanassis
Tsiodras</b></span>
<br><span style=" font-size:10pt;font-family:sans-serif">Real-time Embedded
Software Engineer </span>
<br><span style=" font-size:10pt;font-family:sans-serif">System, Software
and Technology Department</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"><b>ESTEC</b></span>
<br><span style=" font-size:10pt;font-family:sans-serif">Keplerlaan 1,
PO Box 299</span>
<br><span style=" font-size:10pt;font-family:sans-serif">NL-2200 AG Noordwijk,
The Netherlands</span>
<br><span style=" font-size:10pt;font-family:sans-serif">Thanassis.Tsiodras@esa.int
| </span><a href=www.esa.int><span style=" font-size:10pt;color:blue;font-family:sans-serif">www.esa.int</span></a>
<br><span style=" font-size:10pt;font-family:sans-serif">T +31 71 565 5332</span>
<br>
<br>
<br>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">From:
</span><span style=" font-size:9pt;font-family:sans-serif">Chris
Johns <chrisj@rtems.org></span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">To:
</span><span style=" font-size:9pt;font-family:sans-serif">Thanassis.Tsiodras@esa.int,
devel@rtems.org</span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Date:
</span><span style=" font-size:9pt;font-family:sans-serif">28/02/2018
04:43</span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Subject:
</span><span style=" font-size:9pt;font-family:sans-serif">Re:
N2X, GR740 and coverage: The impact of a linkcmds patch from 2014 to gcov_init
calls</span>
<br>
<hr noshade>
<br>
<br>
<br><tt><span style=" font-size:10pt">On 28/02/2018 03:30, Thanassis.Tsiodras@esa.int
wrote:<br>
> What follows is a detailed bug report - and a suggested fix - regarding
the<br>
> impact on calls to "__gcov_init" from a patch made to sparc's
linkscmds file<br>
> back in 2014.<br>
<br>
Thank you for the detail report.<br>
<br>
> <br>
[snip]<br>
> <br>
> Can you please confirm whether this is indeed a bug - and/or indicate
whether<br>
> there's some other workaround that can be used besides "hacking"
the linkcmds<br>
> this way, to make coverage functionality operate properly?<br>
<br>
Do you have a test case with the compile and link commands that can be
used to<br>
show the problem?<br>
<br>
Thanks<br>
Chris<br>
</span></tt>
<br>
<br><PRE>This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.
Please consider the environment before printing this email.
</PRE>