uboot: Use "mdbtrick" target when building elf for ARC
PATCH 1/1 uboot: Use "mdbtrick" target when building elf for ARC
By default position independent executables (PIE) are generated when building U-Boot elf target. MetaWare debugger doesn't support PIE (position-independent executable).
In order to allow MDB load and run U-Boot elf, we need to do a special trick, called "mdbtrick".
This special build target is used to fake generated U-Boot elf by:
1. Reset PIE flag in ELF header
2. Strip all debug information from elf
--- boot/uboot/uboot.mk | 4 ++++ 1 file changed, 4 insertions(+)
boot/uboot/uboot.mk +4 -0
@@ -38,6 +38,10 @@ endif ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y) UBOOT_BIN = u-boot +# To make elf usable for debuging on ARC use special target +ifeq ($(BR2_arc),y) +UBOOT_MAKE_TARGET = mdbtrick +endif else ifeq ($(BR2_TARGET_UBOOT_FORMAT_KWB),y) UBOOT_BIN = u-boot.kwb UBOOT_MAKE_TARGET = $(UBOOT_BIN)
Signature · 1 line
2.5.5
PATCH 1/1 uboot: Use "mdbtrick" target when building elf for ARC
Hello,
Quoted 28 lines · Zakharov Vlad
By default position independent executables (PIE) are generated when building U-Boot elf target. MetaWare debugger doesn't support PIE (position-independent executable).
In order to allow MDB load and run U-Boot elf, we need to do a special trick, called "mdbtrick".
This special build target is used to fake generated U-Boot elf by:
????1. Reset PIE flag in ELF header
????2. Strip all debug information from elfSigned-off-by Zakharov Vlad <[email protected]>---
?boot/uboot/uboot.mk | 4 ++++
?1 file changed, 4 insertions(+)boot/uboot/uboot.mk +0
-0@@ -38,6 +38,10 @@ endif?
?ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
?UBOOT_BIN = u-bootboot/uboot/uboot.mk +4
-0+# To make elf usable for debuging on ARC use special target +ifeq ($(BR2_arc),y) +UBOOT_MAKE_TARGET = mdbtrick +endif
Quoted 3 lines
?else ifeq ($(BR2_TARGET_UBOOT_FORMAT_KWB),y)
?UBOOT_BIN = u-boot.kwb
?UBOOT_MAKE_TARGET = $(UBOOT_BIN)
I'm wondering if there are any comments on that patch? Otherwise please consider to apply it.
Signature · 2 lines
Best regards, Vlad Zakharov <[email protected]>
Thomas Petazzoni
AppliedPATCH 1/1 uboot: Use "mdbtrick" target when building elf for ARC
In reply to Zakharov VladHello,
Quoted 7 lines · Zakharov Vlad
By default position independent executables (PIE) are generated when building U-Boot elf target. MetaWare debugger doesn't support PIE (position-independent executable).
In order to allow MDB load and run U-Boot elf, we need to do a special trick, called "mdbtrick".
Quoted 8 lines
This special build target is used to fake generated U-Boot elf by:
1. Reset PIE flag in ELF header
2. Strip all debug information from elfSigned-off-by Zakharov Vlad <[email protected]>--- boot/uboot/uboot.mk | 4 ++++ 1 file changed, 4 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com