libgcc - Overview from the used functions by gcc depending on the architecture

52 Views Asked by At

Is there somewhere an overview for functions in libgcc, which functions are used for a specific architecture (amd64, ARMv8, ...) ? Major projects like Linux or U-Boot uses their own implementation of these functions. Also a detailed overview on which C code snippet (as example) gcc uses them, would be nice. Currently it's for me an trial and error, when I don't link libgccin my bare-metal projects.

Have searched a long time for such overview, but didn't find any. This question might not be ideal, but don't know where to ask.

1

There are 1 best solutions below

7
John Bollinger On

Is there somewhere an overview for functions in libgcc, which functions are used for a specific architecture (amd64, ARMv8, ...) ?

Not to my knowledge, no. There is GCC documentation on the contents of libgcc, but I don't know any reference material summarizing which functions are used on which architectures.

Major projects like Linux or U-Boot uses their own implementation of these functions.

I'm sure some do. I'm not at all sure that all do. If you don't have your own reasons for writing your own implementations, then you should strongly consider not doing so.

Currently it's for me an trial and error, when I don't link libgcc in my bare-metal projects.

And that's indeed a viable way to figure it out, giving you exactly the information you need to successfully build those projects without relying on libgcc. I understand wanting to know up front, but I don't think such advance knowledge actually helps you very much. Whichever of those functions you need to provide yourself, you need to provide yourself either way.

But if you don't already, you should recognize that you always have the option of linking libgcc into your projects, including for freestanding implementations. You may need to link it statically in some cases. Taking on responsibility for implementing GCC support functions yourself is your choice.