Port-mips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD/arc 9.0 /usr/mdec/boot includes extra debug info?



martin@ wrote:

> On Tue, Jun 02, 2020 at 11:02:16PM +0900, Izumi Tsutsui wrote:
> > Is there any possible build.sh options (or mk.conf definitions)
> > for the release binaries that could cause such difference?
 :
> Yes: build.sh -V MKDEBUG=yes

Ah, I see.

> For normal binaries there is no difference, as the debug info is detached.
> But stand programs / bootloaders may need extra care to strip the resulting
> binary (or override DBG= in the Makefile).

Adding "--strip-debug" to ${OBJCOPY} (for ecoff boot) is enough
to get a working binary even with MKDEBUG=yes:

---
Index: Makefile
===================================================================
RCS file: /cvsroot/src/sys/arch/arc/stand/boot/Makefile,v
retrieving revision 1.17
diff -u -p -d -r1.17 Makefile
--- Makefile	8 Apr 2017 19:53:20 -0000	1.17
+++ Makefile	2 Jun 2020 15:33:57 -0000
@@ -62,7 +62,7 @@ ${PROG}: ${OBJS} ${LIBS}
 	    -e start -o ${PROG}.elf ${OBJS} ${LIBS}
 	@${SIZE} ${PROG}.elf
 	${OBJCOPY} --impure -O ecoff-littlemips \
-	    -R .pdr -R .mdebug.abi32 -R .comment -R .ident \
+	    -R .pdr -R .mdebug.abi32 -R .comment -R .ident --strip-debug \
 	    ${PROG}.elf ${.TARGET}
 
 CLEANFILES+=	${PROG}.elf ${PROG}.map

---

I'll commit and send a pullup request.

Thanks for a quick reply!

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index