[liba] Make sure memset and memcpy are always kept at link time

Works around a bug in GCC
This commit is contained in:
Romain Goyet
2018-10-10 17:23:50 +02:00
committed by LeaNumworks
parent 308ab85173
commit 6f7063dfda
2 changed files with 6 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
#include <string.h>
// Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51205
void * memcpy(void * dst, const void * src, size_t n) __attribute__((externally_visible));
void * memcpy(void * dst, const void * src, size_t n) {
char * destination = (char *)dst;
char * source = (char *)src;

View File

@@ -1,5 +1,8 @@
#include <string.h>
// Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51205
void * memset(void * b, int c, size_t len) __attribute__((externally_visible));
void * memset(void * b, int c, size_t len) {
char * destination = (char *)b;
while (len--) {