On Fri, Jan 28, 2022 at 03:54:00PM +0000, Pedro Falcato wrote:
> Gerd,
> 
> As I mentioned earlier, abort() is one of 5 functions GCC expects in
> freestanding mode (plus memset, mempy and two others).
> 
> Is there any floating point enabled somewhere? I really don't remember
> having seen those undefined references to fprintf, ever.

That is one of the things I havn't figured yet ...

libgcc is basically a collection of object files, and the linker should
cherry-pick those which it needs (for example add the _divdi3.o object
to resolve the __divdi3 symbol) and ignore everything else.

The "ignore everything else" part seems to not work though:

> > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/11/libgcc.a(_absvsi2.o): in
> > function `__absvdi2':
> > (.text+0x18): undefined reference to `abort'

Nothing in edk2 needs __absvdi2.  Nevertheless the linker looks at
_absvsi2.o and tries to resolve the symbols used.

Unpacking libgcc, cherry-picking the object files actually needed, then
packing the picked object files into a library and use that works.  But
IMHO that is something the linker should be able to figure on its own.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86273): https://edk2.groups.io/g/devel/message/86273
Mute This Topic: https://groups.io/mt/87479913/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to