is there a way to override the address of softfloat functions in gcc, such as __floatunsidf and __muldf3? specifically xtensa ESP32 gcc, if that matters at all.

I want to locally compile a function (on desktop) and send the compiled assembly code over the network (signed, obviously) to an ESP32. the code will be passed function pointers so it can access various calls, but that doesn't help with the softfloat functions as the calls are compiler-generated.

@gsuberland

WDYM by address? If these functions were dynamically linked, the address would be found at dynamic linking time, so I assume they are statically linked and included in the piece of code you're generating.

You probably could mess with a custom linker script, so that the relocations that address those functions would be handled differently. You could also use DECLARE_LIBRARY_RENAMES (gcc.gnu.org/onlinedocs/gccint/) to point them at other named functions.

I'm not sure what you want to happen when these functions are called. I presume you'd want to write your own versions of them (that will e.g. proxy to ones already-present in the target). That you should be able to do with either of the approaches above.

Disclaimer: I might be unaware of some additional specialness of softfloat functions from the POV of gcc.

Follow

@gsuberland

Ah, wait, the macro seems to affect the names of the functions that are compiled into libgcc, and not the names used to call them.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.