All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC
@ 2016-05-27 17:51 Zakharov Vlad
  2016-06-07  9:26 ` Vlad Zakharov
  2016-06-12 19:40 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Zakharov Vlad @ 2016-05-27 17:51 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Zakharov Vlad <vzakhar@synopsys.com>
---
 boot/uboot/uboot.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index e739638..d8cdf5c 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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)
-- 
2.5.5

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

* [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC
  2016-05-27 17:51 [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC Zakharov Vlad
@ 2016-06-07  9:26 ` Vlad Zakharov
  2016-06-12 19:40 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Vlad Zakharov @ 2016-06-07  9:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 2016-05-27 at 20:51 +0300, Zakharov Vlad wrote:
> 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
> 
> Signed-off-by: Zakharov Vlad <vzakhar@synopsys.com>
> ---
> ?boot/uboot/uboot.mk | 4 ++++
> ?1 file changed, 4 insertions(+)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index e739638..d8cdf5c 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -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)

I'm wondering if there are any comments on that patch?
Otherwise please consider to apply it.

-- 
Best regards,
Vlad Zakharov <vzakhar@synopsys.com>

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

* [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC
  2016-05-27 17:51 [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC Zakharov Vlad
  2016-06-07  9:26 ` Vlad Zakharov
@ 2016-06-12 19:40 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-06-12 19:40 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 27 May 2016 20:51:41 +0300, Zakharov Vlad wrote:
> 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
> 
> Signed-off-by: Zakharov Vlad <vzakhar@synopsys.com>
> ---
>  boot/uboot/uboot.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-06-12 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27 17:51 [Buildroot] [PATCH] uboot: Use "mdbtrick" target when building elf for ARC Zakharov Vlad
2016-06-07  9:26 ` Vlad Zakharov
2016-06-12 19:40 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.