mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] at91bootstrap: Use generic compile rule
@ 2018-05-21 14:35 Ladislav Michl
  2018-05-21 14:36 ` [ptxdist] [PATCH 2/2] at91bootstrap: Remove notes section Ladislav Michl
  0 siblings, 1 reply; 2+ messages in thread
From: Ladislav Michl @ 2018-05-21 14:35 UTC (permalink / raw)
  To: ptxdist

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 rules/at91bootstrap.make | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/rules/at91bootstrap.make b/rules/at91bootstrap.make
index bdf7942e9..cc24a2a0f 100644
--- a/rules/at91bootstrap.make
+++ b/rules/at91bootstrap.make
@@ -39,22 +39,17 @@ AT91BOOTSTRAP_WRAPPER_BLACKLIST := \
 	TARGET_DEBUG \
 	TARGET_BUILD_ID
 
-AT91BOOTSTRAP_ENV 	:= \
-    CROSS_COMPILE=$(COMPILER_PREFIX) \
-    pkg_wrapper_blacklist="$(AT91BOOTSTRAP_WRAPPER_BLACKLIST)"
-
-AT91BOOTSTRAP_BOOTMEDIA-$(PTXCONF_AT91BOOTSTRAP_BOOT_DATAFLASH) += dataflash
+AT91BOOTSTRAP_BOOTMEDIA-$(PTXCONF_AT91BOOTSTRAP_BOOT_DATAFLASH)	+= dataflash
 AT91BOOTSTRAP_BOOTMEDIA-$(PTXCONF_AT91BOOTSTRAP_BOOT_NAND)	+= nandflash
 
 AT91BOOTSTRAP_BOARDDIR  := \
 	$(AT91BOOTSTRAP_DIR)/board/${PTXCONF_AT91BOOTSTRAP_CONFIG}/$(AT91BOOTSTRAP_BOOTMEDIA-y)
 
-$(STATEDIR)/at91bootstrap.compile:
-	@$(call targetinfo)
-	@cd $(AT91BOOTSTRAP_BOARDDIR) && \
-		$(AT91BOOTSTRAP_PATH) $(AT91BOOTSTRAP_ENV) \
-		$(MAKE) $(PARALLELMFLAGS_BROKEN)
-	@$(call touch)
+AT91BOOTSTRAP_MAKE_ENV	:= $(CROSS_ENV)
+AT91BOOTSTRAP_MAKE_PAR	:= NO
+AT91BOOTSTRAP_MAKE_OPT	:= \
+	CROSS_COMPILE=$(COMPILER_PREFIX) \
+	-C $(AT91BOOTSTRAP_BOARDDIR)
 
 # ----------------------------------------------------------------------------
 # Install
-- 
2.17.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ptxdist] [PATCH 2/2] at91bootstrap: Remove notes section
  2018-05-21 14:35 [ptxdist] [PATCH 1/2] at91bootstrap: Use generic compile rule Ladislav Michl
@ 2018-05-21 14:36 ` Ladislav Michl
  0 siblings, 0 replies; 2+ messages in thread
From: Ladislav Michl @ 2018-05-21 14:36 UTC (permalink / raw)
  To: ptxdist

Wrapper blacklist is no longer enough to prevent creating huge
binaries with Oselas toolchain 2018.02, so patch Makefile to
explicitely remove unwanted sections.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 .../0004-Remove-note-sections.patch           | 402 ++++++++++++++++++
 patches/Bootstrap-v1.16/series                |   1 +
 2 files changed, 403 insertions(+)

diff --git a/patches/Bootstrap-v1.16/0004-Remove-note-sections.patch b/patches/Bootstrap-v1.16/0004-Remove-note-sections.patch
new file mode 100644
index 000000000..cc2cd3933
--- /dev/null
+++ b/patches/Bootstrap-v1.16/0004-Remove-note-sections.patch
@@ -0,0 +1,402 @@
+From: Ladislav Michl <ladis@linux-mips.org>
+Subject: [PATCH] Remove notes sections when producing binary
+
+Some linkers are producing notes section which causes objcopy creating over
+2MiB binary. Fix this by removing whole section - this is what kernel does:
+https://lkml.org/lkml/2011/12/15/162
+
+Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
+---
+ board/at91cap9adk/dataflash/Makefile      |    4 +++-
+ board/at91cap9adk/norflash/Makefile       |    4 +++-
+ board/at91cap9stk/nandflash/Makefile      |    4 +++-
+ board/at91sam9260ek/dataflash/Makefile    |    4 +++-
+ board/at91sam9260ek/nandflash/Makefile    |    4 +++-
+ board/at91sam9261ek/dataflash/Makefile    |    4 +++-
+ board/at91sam9261ek/nandflash/Makefile    |    4 +++-
+ board/at91sam9263ek/dataflash/Makefile    |    4 +++-
+ board/at91sam9263ek/nandflash/Makefile    |    4 +++-
+ board/at91sam9g10ek/dataflash/Makefile    |    4 +++-
+ board/at91sam9g10ek/nandflash/Makefile    |    4 +++-
+ board/at91sam9g20ek/dataflash/Makefile    |    4 +++-
+ board/at91sam9g20ek/nandflash/Makefile    |    4 +++-
+ board/at91sam9g45ekes/nandflash/Makefile  |    4 +++-
+ board/at91sam9m10ekes/dataflash/Makefile  |    4 +++-
+ board/at91sam9m10ekes/nandflash/Makefile  |    4 +++-
+ board/at91sam9m10g45ek/dataflash/Makefile |    4 +++-
+ board/at91sam9m10g45ek/nandflash/Makefile |    4 +++-
+ board/at91sam9rlek/dataflash/Makefile     |    4 +++-
+ board/at91sam9rlek/nandflash/Makefile     |    4 +++-
+ board/at91sam9xeek/dataflash/Makefile     |    4 +++-
+ board/at91sam9xeek/nandflash/Makefile     |    4 +++-
+ lib/Makefile                              |    4 +++-
+ 23 files changed, 69 insertions(+), 23 deletions(-)
+
+--- a/board/at91cap9adk/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91cap9adk/dataflash/Makefile	2018-05-21 15:46:47.965572041 +0200
+@@ -65,10 +65,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 	
+ 	
+--- a/board/at91cap9adk/norflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91cap9adk/norflash/Makefile	2018-05-21 15:46:47.965572041 +0200
+@@ -65,10 +65,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 	
+ 	
+--- a/board/at91cap9stk/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91cap9stk/nandflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9260ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9260ek/dataflash/Makefile	2018-05-21 15:46:47.965572041 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9260ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9260ek/nandflash/Makefile	2018-05-21 15:46:47.965572041 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9261ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9261ek/dataflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9261ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9261ek/nandflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9263ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9263ek/dataflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -65,10 +65,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 	
+ 	
+--- a/board/at91sam9263ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9263ek/nandflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -64,10 +64,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 	
+ 	
+--- a/board/at91sam9g10ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9g10ek/dataflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9g10ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9g10ek/nandflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9g20ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9g20ek/dataflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9g20ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9g20ek/nandflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9g45ekes/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9g45ekes/nandflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9m10ekes/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9m10ekes/dataflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9m10ekes/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9m10ekes/nandflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9m10g45ek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9m10g45ek/dataflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9m10g45ek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9m10g45ek/nandflash/Makefile	2018-05-21 15:46:47.985572522 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9rlek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9rlek/dataflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ $(BOARD).o: $(BOOTSTRAP_PATH)/board/$(BOARD)/$(BOARD).c 
+--- a/board/at91sam9rlek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9rlek/nandflash/Makefile	2018-05-21 15:46:47.965572041 +0200
+@@ -69,10 +69,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/board/at91sam9xeek/dataflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9xeek/dataflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -72,10 +72,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ $(BOARD).o: $(BOOTSTRAP_PATH)/board/$(BOARD)/$(BOARD).c 
+--- a/board/at91sam9xeek/nandflash/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/board/at91sam9xeek/nandflash/Makefile	2018-05-21 15:46:47.975572282 +0200
+@@ -72,10 +72,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ 
+--- a/lib/Makefile	2018-05-21 15:48:07.887504700 +0200
++++ b/lib/Makefile	2018-05-21 15:53:48.685832495 +0200
+@@ -68,10 +68,12 @@
+ 
+ all: 	$(BOOT_NAME)
+ 
++REMOVE_SECTIONS=-R .note -R .comment -R .note.gnu.build-id
++
+ ifeq ($(TOOLCHAIN), gcc)
+ $(BOOT_NAME): $(OBJS)
+ 	$(LD) $(LDFLAGS) -n -o $(BOOT_NAME).elf $(OBJS)
+-	$(OBJCOPY) --strip-debug --strip-unneeded $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
++	$(OBJCOPY) --strip-debug --strip-unneeded $(REMOVE_SECTIONS) $(BOOT_NAME).elf -O binary $(BOOT_NAME).bin
+ endif
+ 
+ $(BOARD).o: $(BOOTSTRAP_PATH)/board/$(BOARD)/$(BOARD).c 
diff --git a/patches/Bootstrap-v1.16/series b/patches/Bootstrap-v1.16/series
index 6a1114f44..82fdb3ca3 100644
--- a/patches/Bootstrap-v1.16/series
+++ b/patches/Bootstrap-v1.16/series
@@ -3,4 +3,5 @@
 0001-crt0_gnu.S-fix-image-size.patch
 0002-elf32-littlearm.lds-fix-overlap-linker-error.patch
 0003-Fix-build-with-EABI-toolchain.patch
+0004-Remove-note-sections.patch
 # 0771a94d6e5f085e4c18dcea3102d267  - git-ptx-patches magic
-- 
2.17.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-21 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-21 14:35 [ptxdist] [PATCH 1/2] at91bootstrap: Use generic compile rule Ladislav Michl
2018-05-21 14:36 ` [ptxdist] [PATCH 2/2] at91bootstrap: Remove notes section Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox