* [Buildroot] [PATCH] toolchain: arc-2016.03: fix generation of dynamic relocs for -pie
@ 2016-05-25 12:01 Alexey Brodkin
2016-05-26 19:20 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Brodkin @ 2016-05-25 12:01 UTC (permalink / raw)
To: buildroot
Currently even if -pie flag is provided to LD dynamic relocations
won't be created. That in its turn will break U-Boot self-relocation
functionality.
This fix resolves mentioned problem.
Note as of today this is a sort of off-the-tree patch right from
our binutils guy but in coming day similar fix will be applied to
upstream binutils as well.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
...ith-dynamic-relocs-not-being-generated-wi.patch | 34 ++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 package/binutils/arc-2016.03/0700-Fix-issue-with-dynamic-relocs-not-being-generated-wi.patch
diff --git a/package/binutils/arc-2016.03/0700-Fix-issue-with-dynamic-relocs-not-being-generated-wi.patch b/package/binutils/arc-2016.03/0700-Fix-issue-with-dynamic-relocs-not-being-generated-wi.patch
new file mode 100644
index 0000000..c2967a3
--- /dev/null
+++ b/package/binutils/arc-2016.03/0700-Fix-issue-with-dynamic-relocs-not-being-generated-wi.patch
@@ -0,0 +1,34 @@
+From e59d8728f2fd57938ff28bb48cb47ddc7dbf8271 Mon Sep 17 00:00:00 2001
+From: Cupertino Miranda <cmiranda@synopsys.com>
+Date: Tue, 24 May 2016 18:00:28 +0200
+Subject: [PATCH] Fix issue with dynamic relocs not being generated with -pie.
+
+---
+ bfd/elf32-arc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
+index c2d05e4..00af1a5 100644
+--- a/bfd/elf32-arc.c
++++ b/bfd/elf32-arc.c
+@@ -1492,7 +1492,7 @@ elf_arc_relocate_section (bfd * output_bfd,
+ case R_ARC_32_ME:
+ case R_ARC_PC32:
+ case R_ARC_32_PCREL:
+- if (bfd_link_pic (info) && !bfd_link_pie (info)
++ if ((bfd_link_pic (info) || bfd_link_pie (info))
+ && ((r_type != R_ARC_PC32 && r_type != R_ARC_32_PCREL)
+ || (h != NULL
+ && h->dynindx != -1
+@@ -1774,7 +1774,7 @@ elf_arc_check_relocs (bfd * abfd,
+ /* FALLTHROUGH */
+ case R_ARC_PC32:
+ case R_ARC_32_PCREL:
+- if (bfd_link_pic (info) && !bfd_link_pie (info)
++ if ((bfd_link_pic (info) || bfd_link_pie (info))
+ && ((r_type != R_ARC_PC32 && r_type != R_ARC_32_PCREL)
+ || (h != NULL
+ && h->dynindx != -1
+--
+2.5.5
+
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] toolchain: arc-2016.03: fix generation of dynamic relocs for -pie
2016-05-25 12:01 [Buildroot] [PATCH] toolchain: arc-2016.03: fix generation of dynamic relocs for -pie Alexey Brodkin
@ 2016-05-26 19:20 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-05-26 19:20 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 25 May 2016 15:01:40 +0300, Alexey Brodkin wrote:
> Currently even if -pie flag is provided to LD dynamic relocations
> won't be created. That in its turn will break U-Boot self-relocation
> functionality.
>
> This fix resolves mentioned problem.
>
> Note as of today this is a sort of off-the-tree patch right from
> our binutils guy but in coming day similar fix will be applied to
> upstream binutils as well.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> ---
> ...ith-dynamic-relocs-not-being-generated-wi.patch | 34 ++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
> create mode 100644 package/binutils/arc-2016.03/0700-Fix-issue-with-dynamic-relocs-not-being-generated-wi.patch
Applied to next, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-26 19:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 12:01 [Buildroot] [PATCH] toolchain: arc-2016.03: fix generation of dynamic relocs for -pie Alexey Brodkin
2016-05-26 19:20 ` 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.