mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-15 19:22:45 +03:00
Modify the linker script to move some code into flash, enable -mtext-section-literals
This commit is contained in:
@@ -17,19 +17,39 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
extern "C" {
|
||||
#include "ets_sys.h"
|
||||
#include "os_type.h"
|
||||
#include "osapi.h"
|
||||
#include "mem.h"
|
||||
#include "user_interface.h"
|
||||
}
|
||||
|
||||
void *operator new(size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void operator delete(void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
|
||||
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
|
||||
|
||||
void __cxa_pure_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
abort();
|
||||
}
|
||||
|
||||
void __cxa_deleted_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user