mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <biessmann@corscience.de>
To: "Andreas Bießmann" <biessmann@corscience.de>
Cc: oselas@community.pengutronix.de, ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH][OSELAS.Toolchain] binutils-2.21.1a: remove annoying 'warn-on-all-TEXTRELs.patch'
Date: Mon, 13 Aug 2012 11:43:15 +0200	[thread overview]
Message-ID: <5028CC33.1010403@corscience.de> (raw)
In-Reply-To: <1332233783-15999-1-git-send-email-biessmann@corscience.de>

On 20.03.2012 09:56, Andreas Bießmann wrote:
> The 'warn-on-all-TEXTRELs.patch' produces warnings on some embedded projects:
> 
> ---8<---
> arm-v5te-linux-gnueabi-ld: warning: creating a DT_TEXTREL in object.
>    text	   data	    bss	    dec	    hex	filename
>  423076	   7480	 305016	 735572	  b3954	/tmp/build_arm_at91/u-boot
> --->8---
> 
> This renders this toolchain nearly un-usable for this use-case. If one will
> see these warnings he can always use the '--warn-shared-textrel' switch so
> this patch will only revert the 'default to warn' to 'default to ignore
> warning' which is in fact the default for GNU linker.
> 
> Another point is that even crosstool-ng has switched back and removed this
> patch, it seems there are some other users bothered by that warning.
> 
> Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
> ---

Any comment on that patch?

>  ...1-05-31-Paul-Brook-paul-codesourcery.com.patch} |    0
>  .../0002-warn-on-all-TEXTRELs.patch                |   80 --------------------
>  patches/binutils-2.21.1a/series                    |    5 +-
>  3 files changed, 2 insertions(+), 83 deletions(-)
>  rename patches/binutils-2.21.1a/{0003-2011-05-31-Paul-Brook-paul-codesourcery.com.patch => 0002-2011-05-31-Paul-Brook-paul-codesourcery.com.patch} (100%)
>  delete mode 100644 patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch
> 
> diff --git a/patches/binutils-2.21.1a/0003-2011-05-31-Paul-Brook-paul-codesourcery.com.patch b/patches/binutils-2.21.1a/0002-2011-05-31-Paul-Brook-paul-codesourcery.com.patch
> similarity index 100%
> rename from patches/binutils-2.21.1a/0003-2011-05-31-Paul-Brook-paul-codesourcery.com.patch
> rename to patches/binutils-2.21.1a/0002-2011-05-31-Paul-Brook-paul-codesourcery.com.patch
> diff --git a/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch b/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch
> deleted file mode 100644
> index 3be8fae..0000000
> --- a/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch
> +++ /dev/null
> @@ -1,80 +0,0 @@
> -From: unknown author <unknown.author@example.com>
> -Date: Tue, 1 Nov 2011 16:44:50 +0100
> -Subject: [PATCH] warn on all TEXTRELs
> -
> -textrels are bad for forcing copy-on-write (this affects everyone),
> -and for security/runtime code generation, this affects security ppl.
> -But in either case, it doesn't matter who needs textrels, it's
> -the very fact that they're needed at all.
> -
> -2006-06-10  Ned Ludd  <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org>
> -
> -	* bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
> -	* ld/ldmain.c (main): Change textrel warning default to true.
> -	* ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
> -	warnings from ld output.
> -
> -Original patch from gentoo. Also used by crosstool-ng (binutils-2.20.1a).
> ----
> - bfd/elflink.c               |    8 +++-----
> - ld/ldmain.c                 |    1 +
> - ld/testsuite/lib/ld-lib.exp |    4 ++++
> - 3 files changed, 8 insertions(+), 5 deletions(-)
> -
> -diff --git a/bfd/elflink.c b/bfd/elflink.c
> -index 9e69ec6..0396659 100644
> ---- a/bfd/elflink.c
> -+++ b/bfd/elflink.c
> -@@ -11114,14 +11114,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
> - 	goto error_return;
> - 
> -       /* Check for DT_TEXTREL (late, in case the backend removes it).  */
> --      if (info->warn_shared_textrel && info->shared)
> -+      o = bfd_get_section_by_name (dynobj, ".dynamic");
> -+      if (info->warn_shared_textrel && o != NULL)
> - 	{
> - 	  bfd_byte *dyncon, *dynconend;
> - 
> - 	  /* Fix up .dynamic entries.  */
> --	  o = bfd_get_section_by_name (dynobj, ".dynamic");
> --	  BFD_ASSERT (o != NULL);
> --
> - 	  dyncon = o->contents;
> - 	  dynconend = o->contents + o->size;
> - 	  for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
> -@@ -11133,7 +11131,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
> - 	      if (dyn.d_tag == DT_TEXTREL)
> - 		{
> - 		 info->callbacks->einfo
> --		    (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
> -+		    (_("%P: warning: creating a DT_TEXTREL in object.\n"));
> - 		  break;
> - 		}
> - 	    }
> -diff --git a/ld/ldmain.c b/ld/ldmain.c
> -index 96f3bda..9f88cc4 100644
> ---- a/ld/ldmain.c
> -+++ b/ld/ldmain.c
> -@@ -287,6 +287,7 @@ main (int argc, char **argv)
> -   emulation = get_emulation (argc, argv);
> -   ldemul_choose_mode (emulation);
> -   default_target = ldemul_choose_target (argc, argv);
> -+  link_info.warn_shared_textrel = TRUE;
> -   config.maxpagesize = bfd_emul_get_maxpagesize (default_target);
> -   config.commonpagesize = bfd_emul_get_commonpagesize (default_target);
> -   lang_init ();
> -diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
> -index f444da7..f935f12 100644
> ---- a/ld/testsuite/lib/ld-lib.exp
> -+++ b/ld/testsuite/lib/ld-lib.exp
> -@@ -206,6 +206,10 @@ proc default_ld_simple_link { ld target objects } {
> -     # symbol, since the default linker script might use ENTRY.
> -     regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
> - 
> -+    # Gentoo tweak:
> -+    # We want to ignore TEXTREL warnings since we force enable them by default
> -+    regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
> -+
> -     if [string match "" $exec_output] then {
> - 	return 1
> -     } else {
> diff --git a/patches/binutils-2.21.1a/series b/patches/binutils-2.21.1a/series
> index bab2133..f0d739a 100644
> --- a/patches/binutils-2.21.1a/series
> +++ b/patches/binutils-2.21.1a/series
> @@ -1,6 +1,5 @@
>  # generated by git-ptx-patches
>  #tag:base --start-number 1
>  0001-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
> -0002-warn-on-all-TEXTRELs.patch
> -0003-2011-05-31-Paul-Brook-paul-codesourcery.com.patch
> -# df7383a34a1fb7245bbcc4a517757b0a  - git-ptx-patches magic
> +0002-2011-05-31-Paul-Brook-paul-codesourcery.com.patch
> +# ab44a8a2deb9ac0a004704a7638a046e  - git-ptx-patches magic
> 


-- 
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2012-08-13  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20  8:56 Andreas Bießmann
2012-08-13  9:43 ` Andreas Bießmann [this message]

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=5028CC33.1010403@corscience.de \
    --to=biessmann@corscience.de \
    --cc=oselas@community.pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox