grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEED_REGISTER_FRAME_INFO can be replaced by -static-libgcc


From: Christian Franke
Subject: Re: NEED_REGISTER_FRAME_INFO can be replaced by -static-libgcc
Date: Wed, 14 Apr 2010 12:35:32 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3

Vladimir 'φ-coder/phcoder' Serbinenko wrote:
Christian Franke wrote:
The *_frame_info symbols are set undefined to force linkage of the
libgcc_s shared library or dll.

This can be prevented by TARGET_LDFLAGS=-static-libgcc. To build from
grub-1.98 tarball on Cygwin, run configure with this argument.

May also be necessary on other build platforms when -shared-libgcc is
the default. It may be possible simply set -static-libgcc
unconditionally.

We already supply -lgcc --static-libgcc. Do you know why it still had
issues?

The above is only set when linking the kernel image.

According to 'gcc -dumpspecs' of Cygwin gcc 4.3.4-3, options '-u ___[de]register_frame_info' are always passed to the linker if -static-libgcc is not specified. This is Cygwin and MinGW specific: In the exe startup code these symbols are loaded only if present, so the DLL must be forced to load first.

As a consequence, the symbols are also set undefined when the GRUB pre-*.o files are generated with 'ld -r'.

The attached patch works for me with the bzr revision preceding the NEED_REGISTER_FRAME_INFO fix.


And I also doubt usefullness of pulling these functions since reference
to them is purely dummy: no relocation uses it so it will only increase
code size. Another concern is the behviour of these functions in grub
environment if they ever get called.


AFAICS from the gcc source, the functions are used in EH stack unwinding code in libgcc. The compiler itself does not generate calls to these functions.


--
Regards,
Christian Franke

Attachment: grub2-static-libgcc.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]