Skip to content

Support for -m32 #8

@stefanct

Description

@stefanct

Since this tools is particularly useful for evaluating software destined for embedded systems while running it on desktops it would be great to support -m32 (and -mx32) binaries because they make the numbers more precise for typical 32-bit embedded architectures.

If you try to run such a binary right now you would get:

ERROR: ld.so: object '…/build/libstackusage.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

Interestingly, there does not seem to be a proper error handling that stops execution at that point but the binary gets executed just fine afterwards, trailed by a funny-looking error message:

error: unable to preload libstackusage.so

To get it to work (but break ordinary binaries) one can simply append -m32 to the CMAKE_C_FLAGS in CMakeLists.txt.

I have not looked at the code and don't have time to properly implement this (and I am fine with the mentioned workaround) but at least this limitation is documented now. Thank you - the tool is very useful!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions