Remove libgcc dependency.
libgcc for boot environment isn't always present and compatible. libgcc is often absent if endianness or bit-size at boot is different from running OS. libgcc may use optimised opcodes that aren't available on boot time. So instead of relying on libgcc shipped with the compiler, supply the functions in GRUB directly. Tests are present to ensure that those replacement functions behave the way compiler expects them to.
This commit is contained in:
parent
77697d14e5
commit
064360e667
21 changed files with 1441 additions and 479 deletions
|
@ -21,7 +21,7 @@
|
|||
#include <grub/decompressor.h>
|
||||
|
||||
void *
|
||||
memset (void *s, int c, grub_size_t len)
|
||||
grub_memset (void *s, int c, grub_size_t len)
|
||||
{
|
||||
grub_uint8_t *ptr;
|
||||
for (ptr = s; len; ptr++, len--)
|
||||
|
@ -68,15 +68,6 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memcmp")));
|
||||
|
||||
void *memmove (void *dest, const void *src, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memmove")));
|
||||
|
||||
void *memcpy (void *dest, const void *src, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memmove")));
|
||||
|
||||
void *grub_decompressor_scratch;
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue