Discussion:
Dead code elimination
(too old to reply)
Byron Blue
2017-03-10 15:54:43 UTC
Permalink
We've recently experienced a issues with our software in the field: Integer
division by zero. When I check the memory map it seems to point to a
function in clib3r.lib(abort.c) called terminate. This area is listed in the
.map file as an unreferenced symbol (not used in our code). Unknown to me
why this would occur but a few screenshots from different customers point to
the same area.
Should I be checking the box in the Linker Switches to Eliminate dead code
[op el]? Is it possible this unused function is causing an issue?

Byron Blue
Paul S. Person
2017-03-10 17:53:32 UTC
Permalink
On Fri, 10 Mar 2017 10:54:43 -0500, "Byron Blue"
Post by Byron Blue
We've recently experienced a issues with our software in the field: Integer
division by zero. When I check the memory map it seems to point to a
function in clib3r.lib(abort.c) called terminate. This area is listed in the
.map file as an unreferenced symbol (not used in our code). Unknown to me
why this would occur but a few screenshots from different customers point to
the same area.
Should I be checking the box in the Linker Switches to Eliminate dead code
[op el]? Is it possible this unused function is causing an issue?
Unless you have already done so, you need to use the debugger to find
out where that function is called from.

Since you will probably find yourself looking at assembly with no
debugging info, you will need to back up until you reach your own
code.

And then see if, by any chance, you actually /are/ dividing by zero.
--
"Nature must be explained in
her own terms through
the experience of our senses."
Loading...