All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 12/16] elf2flt: use new upstream site and add ARM patch
Date: Thu, 17 Mar 2016 00:50:59 +0100	[thread overview]
Message-ID: <56E9F163.5080304@mind.be> (raw)
In-Reply-To: <1458164602-16983-13-git-send-email-thomas.petazzoni@free-electrons.com>

On 03/16/16 22:43, Thomas Petazzoni wrote:
> The uClinux developers now have a Github with elf2flt code, with an
> upstream that is again active. Let's switch to this upstream, to which
> Waldemar is contributing as well.

  While at it, you could have added a hash file.

>
> We also add an ARM patch from Waldemar, which was on his elf2flt
> repository and he submitted upstream.

  That probably should have been a separate patch.


  Regards,
  Arnout


>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>   .../0001-allow-to-build-arm-flat-binaries.patch    | 123 +++++++++++++++++++++
>   package/elf2flt/elf2flt.mk                         |   5 +-
>   2 files changed, 125 insertions(+), 3 deletions(-)
>   create mode 100644 package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
>
> diff --git a/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
> new file mode 100644
> index 0000000..a6c63c5
> --- /dev/null
> +++ b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
> @@ -0,0 +1,123 @@
> +From 56b082412c6f49d21f5e54831a40d1e7c45b3ee4 Mon Sep 17 00:00:00 2001
> +From: Waldemar Brodkorb <wbx@openadk.org>
> +Date: Sat, 12 Mar 2016 22:09:30 +0100
> +Subject: [PATCH] allow to build arm flat binaries
> +
> +Add patchset from ptxdist which is required to produce working
> +ARM flat binaries. Tested with busybox on Kinetis K70.
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> + elf2flt.c     | 19 ++++++++++++-------
> + elf2flt.ld.in | 17 ++++++++++++++---
> + 2 files changed, 26 insertions(+), 10 deletions(-)
> +
> +diff --git a/elf2flt.c b/elf2flt.c
> +index fcd797c..c6978e1 100644
> +--- a/elf2flt.c
> ++++ b/elf2flt.c
> +@@ -56,6 +56,8 @@ const char *elf2flt_progname;
> +
> + #if defined(TARGET_h8300)
> + #include <elf/h8.h>      /* TARGET_* ELF support for the BFD library            */
> ++#elif defined(TARGET_arm)
> ++#include <elf/arm.h>
> + #elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2)
> + #include "cygwin-elf.h"	/* Cygwin uses a local copy */
> + #elif defined(TARGET_xtensa)
> +@@ -646,16 +648,23 @@ dump_symbols(symbols, number_of_symbols);
> + 				default:
> + 					goto good_32bit_resolved_reloc;
> + #elif defined(TARGET_arm)
> ++				case R_ARM_TARGET1:
> ++				case R_ARM_TARGET2:
> + 				case R_ARM_ABS32:
> + 					relocation_needed = 1;
> + 					break;
> + 				case R_ARM_REL32:
> ++				case R_ARM_JUMP24:
> ++				case R_ARM_CALL:
> + 				case R_ARM_THM_PC11:
> + 				case R_ARM_THM_PC22:
> ++				case R_ARM_THM_JUMP24:
> + 				case R_ARM_PC24:
> + 				case R_ARM_PLT32:
> + 				case R_ARM_GOTPC:
> + 				case R_ARM_GOT32:
> ++				case R_ARM_PREL31:
> ++				case R_ARM_NONE:
> + 					relocation_needed = 0;
> + 					break;
> + 				default:
> +@@ -871,9 +880,7 @@ dump_symbols(symbols, number_of_symbols);
> + 					relocation_needed = 1;
> + 					if (verbose)
> + 						fprintf(stderr,
> +-							"%s vma=0x%x, "
> +-							"value=0x%"BFD_VMA_FMT"x, "
> +-							"address=0x%"BFD_VMA_FMT"x "
> ++							"%s vma=0x%x, value=0x%x, address=0x%x "
> + 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
> + 							"ABS32",
> + 							sym_vma, (*(q->sym_ptr_ptr))->value,
> +@@ -890,9 +897,7 @@ dump_symbols(symbols, number_of_symbols);
> + 				case R_ARM_PLT32:
> + 					if (verbose)
> + 						fprintf(stderr,
> +-							"%s vma=0x%x, "
> +-							"value=0x%"BFD_VMA_FMT"x, "
> +-							"address=0x%"BFD_VMA_FMT"x "
> ++							"%s vma=0x%x, value=0x%x, address=0x%x "
> + 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
> + 							"PLT32",
> + 							sym_vma, (*(q->sym_ptr_ptr))->value,
> +@@ -1446,7 +1451,7 @@ DIS29_RELOCATION:
> + 				}
> + 			}
> +
> +-			sprintf(&addstr[0], "+0x%lx", sym_addr - (*(q->sym_ptr_ptr))->value -
> ++			sprintf(&addstr[0], "+0x%x", sym_addr - (*(q->sym_ptr_ptr))->value -
> + 					 bfd_section_vma(abs_bfd, sym_section));
> +
> +
> +diff --git a/elf2flt.ld.in b/elf2flt.ld.in
> +index bfda0ef..ec1fe6f 100644
> +--- a/elf2flt.ld.in
> ++++ b/elf2flt.ld.in
> +@@ -35,6 +35,8 @@ W_RODAT		*(.rodata1)
> + W_RODAT		*(.rodata.*)
> + W_RODAT		*(.gnu.linkonce.r*)
> +
> ++		/* .ARM.extab name sections containing exception unwinding information */
> ++		*(.ARM.extab* .gnu.linkonce.armextab.*)
> + 		/* This is special code area at the end of the normal
> + 		   text section.  It contains a small lookup table at
> + 		   the start followed by the code pointed to by entries
> +@@ -43,11 +45,20 @@ W_RODAT		*(.gnu.linkonce.r*)
> + 		PROVIDE(@SYMBOL_PREFIX at __ctbp = .);
> + 		*(.call_table_data)
> + 		*(.call_table_text)
> +-
> +-		. = ALIGN(0x20) ;
> +-		@SYMBOL_PREFIX at _etext = . ;
> + 	} > flatmem :text
> +
> ++	/* .ARM.exidx name sections containing index entries for section unwinding */
> ++	/* .ARM.exidx is sorted, so has to go in its own output section.  */
> ++	@SYMBOL_PREFIX at __exidx_start = .;
> ++	.ARM.exidx :
> ++	{
> ++		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
> ++	} > flatmem
> ++	@SYMBOL_PREFIX at __exidx_end = .;
> ++
> ++	. = ALIGN(0x20) ;
> ++	@SYMBOL_PREFIX at _etext = . ;
> ++
> + 	.data : {
> + 		. = ALIGN(0x4) ;
> + 		@SYMBOL_PREFIX at _sdata = . ;
> +--
> +2.6.4
> +
> diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk
> index bec270b..796313b 100644
> --- a/package/elf2flt/elf2flt.mk
> +++ b/package/elf2flt/elf2flt.mk
> @@ -4,9 +4,8 @@
>   #
>   ################################################################################
>
> -ELF2FLT_VERSION = f859213b18a67fcfc09961267e0a1122d35186f4
> -ELF2FLT_SITE = http://cgit.openadk.org/cgi/cgit/elf2flt.git
> -ELF2FLT_SITE_METHOD = git
> +ELF2FLT_VERSION = 177ec2701aba30270ec1260746b8db5442c77ef4
> +ELF2FLT_SITE = $(call github,uclinux-dev,elf2flt,$(ELF2FLT_VERSION))
>   ELF2FLT_LICENSE = GPLv2+
>   ELF2FLT_LICENSE_FILES = LICENSE.TXT
>
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2016-03-16 23:50 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 21:43 [Buildroot] [PATCH 00/16] ARM Cortex-M support Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 01/16] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
2016-03-16 22:29   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 02/16] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
2016-03-16 22:43   ` Arnout Vandecappelle
2016-03-17  8:03     ` Thomas Petazzoni
2016-03-17 11:08       ` Peter Korsgaard
2016-03-17 13:06         ` Thomas Petazzoni
2016-03-17 20:36     ` Thomas Petazzoni
2016-03-17 22:34       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 03/16] arch/arm: add Cortex-M4 entry Thomas Petazzoni
2016-03-16 22:50   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 04/16] uclibc: Enable compile in thumb mode when selected Thomas Petazzoni
2016-03-16 23:01   ` Arnout Vandecappelle
2016-03-17 11:21   ` Peter Korsgaard
2016-03-17 13:10     ` Thomas Petazzoni
2016-03-17 21:25     ` Thomas Petazzoni
2016-03-17 21:44       ` Peter Korsgaard
2016-03-17 22:03         ` Thomas Petazzoni
2016-03-17 22:18           ` Peter Korsgaard
2016-03-16 21:43 ` [Buildroot] [PATCH 05/16] uclibc: disable DOPIC on ARM noMMU Thomas Petazzoni
2016-03-16 23:09   ` Arnout Vandecappelle
2016-03-17  8:06     ` Thomas Petazzoni
2016-03-17 10:32       ` Max Filippov
2016-03-17 11:00         ` Thomas Petazzoni
2016-03-17 11:39           ` Max Filippov
2016-03-16 21:43 ` [Buildroot] [PATCH 06/16] uclibc: NPTL thread implementation only available on MMU platforms Thomas Petazzoni
2016-03-16 23:11   ` Arnout Vandecappelle
2016-03-17 12:14   ` Peter Korsgaard
2016-03-17 13:11     ` Thomas Petazzoni
2016-03-17 19:45       ` Waldemar Brodkorb
2016-03-17 20:08         ` Peter Korsgaard
2016-03-16 21:43 ` [Buildroot] [PATCH 07/16] musl: build broken on Thumb, use ARM mode Thomas Petazzoni
2016-03-16 23:14   ` Arnout Vandecappelle
2016-03-17  8:10     ` Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 08/16] toolchain-buildroot: update glibc comment for noMMU Thomas Petazzoni
2016-03-16 23:18   ` Arnout Vandecappelle
2016-03-18 20:49     ` Thomas Petazzoni
2016-03-18 20:59       ` Peter Korsgaard
2016-03-18 21:33       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 09/16] toolchain-buildroot: don't show musl on noMMU platforms Thomas Petazzoni
2016-03-16 23:26   ` Arnout Vandecappelle
2016-03-18 20:51     ` Thomas Petazzoni
2016-03-18 21:42       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 10/16] arch/arm: add support for hard-float on Cortex-M4 Thomas Petazzoni
2016-03-16 23:45   ` Arnout Vandecappelle
2016-03-17  8:16     ` Thomas Petazzoni
2016-03-18 21:47       ` Arnout Vandecappelle
2016-03-18 22:29         ` Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 11/16] package/Makefile.in: adjust LDFLAGS for elf2flt Thomas Petazzoni
2016-03-16 23:48   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 12/16] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
2016-03-16 23:50   ` Arnout Vandecappelle [this message]
2016-03-17  8:18     ` Thomas Petazzoni
2016-03-17 18:53       ` Mike Frysinger
2016-03-17 19:41         ` Waldemar Brodkorb
2016-03-17 20:34         ` Thomas Petazzoni
2016-03-17 20:45           ` Mike Frysinger
2016-03-17 19:39   ` Waldemar Brodkorb
2016-03-16 21:43 ` [Buildroot] [PATCH 13/16] elf2flt: disable Werror to avoid build issues Thomas Petazzoni
2016-03-16 23:53   ` Arnout Vandecappelle
2016-03-17  8:18     ` Thomas Petazzoni
2016-03-17  1:40   ` Mike Frysinger
2016-03-17  8:19     ` Thomas Petazzoni
2016-03-17 18:57       ` Mike Frysinger
2016-03-16 21:43 ` [Buildroot] [PATCH 14/16] afboot-stm32: use the Buildroot toolchain Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 15/16] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 16/16] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E9F163.5080304@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.