x86: garbage collect section if not debugging
This commit is contained in:
parent
a0985e8819
commit
6a75a14ce5
@ -11,9 +11,6 @@ DEBUGGER = $(TERMPROG)
|
|||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
all-debug: export CFLAGS += -ggdb3 -O0
|
|
||||||
all-debug: all
|
|
||||||
|
|
||||||
debug-kdbg: DEBUGGER_FLAGS="kdbg -r :1234 -- $(ELFFILE)"
|
debug-kdbg: DEBUGGER_FLAGS="kdbg -r :1234 -- $(ELFFILE)"
|
||||||
debug-kdbg: debug
|
debug-kdbg: debug
|
||||||
|
|
||||||
@ -26,4 +23,4 @@ debug-tui: debug
|
|||||||
debug-gdb: debug
|
debug-gdb: debug
|
||||||
DEBUGGER_FLAGS = "x-terminal-emulator -e gdb -ex 'target remote :1234' --args $(ELFFILE)"
|
DEBUGGER_FLAGS = "x-terminal-emulator -e gdb -ex 'target remote :1234' --args $(ELFFILE)"
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
|
|||||||
@ -55,12 +55,18 @@ export OFLAGS = -O binary
|
|||||||
LINKFLAGS += -m32 -nostdlib -nostdinc -nostartfiles -nodefaultlibs \
|
LINKFLAGS += -m32 -nostdlib -nostdinc -nostartfiles -nodefaultlibs \
|
||||||
--prefix=$(NEWLIB_BASE) \
|
--prefix=$(NEWLIB_BASE) \
|
||||||
-Wl,-rpath,$(NEWLIB_BASE)/lib \
|
-Wl,-rpath,$(NEWLIB_BASE)/lib \
|
||||||
-T $(RIOTBASE)/boards/x86-multiboot-common/linker.ld
|
-T$(RIOTBASE)/boards/x86-multiboot-common/linker.ld
|
||||||
UNDEF += $(BINDIR)x86-multiboot-common_base/startup.o
|
UNDEF += $(BINDIR)x86-multiboot-common_base/startup.o
|
||||||
|
|
||||||
#CFLAGS += -ffunction-sections -fdata-sections
|
|
||||||
#LINKFLAGS += -Wl,--gc-sections
|
|
||||||
#CFLAGS += -Wall -Wextra -Werror -pedantic -pedantic-errors \
|
|
||||||
|
|
||||||
BASELIBS += $(NEWLIB_BASE)/lib/libc.a \
|
BASELIBS += $(NEWLIB_BASE)/lib/libc.a \
|
||||||
$(NEWLIB_BASE)/lib/libm.a
|
$(NEWLIB_BASE)/lib/libm.a
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
all-debug: export CFLAGS += -ggdb3 -O0
|
||||||
|
all-debug: all
|
||||||
|
|
||||||
|
ifeq (, $(filter all-debug, $(MAKECMDGOALS)))
|
||||||
|
CFLAGS += -Os -ffunction-sections -fdata-sections
|
||||||
|
LINKFLAGS += -Wl,--gc-sections
|
||||||
|
endif
|
||||||
|
|||||||
@ -34,7 +34,7 @@ SECTIONS
|
|||||||
Next we'll put the .text section. */
|
Next we'll put the .text section. */
|
||||||
._multiboot_header :
|
._multiboot_header :
|
||||||
{
|
{
|
||||||
*(._multiboot_header)
|
KEEP(*(._multiboot_header))
|
||||||
}
|
}
|
||||||
|
|
||||||
.note.gnu.build-id :
|
.note.gnu.build-id :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user