Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86
@ 2022-02-11 18:06 Waldemar Brodkorb
  2022-02-13 20:45 ` Thomas Petazzoni via buildroot
  2022-02-14 21:06 ` Arnout Vandecappelle
  0 siblings, 2 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2022-02-11 18:06 UTC (permalink / raw)
  To: buildroot

See here:
https://sourceware.org/bugzilla/show_bug.cgi?id=28870

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 ...OT32-relocations-against-ABS-symbols.patch | 46 ++++++++++++++++
 ...OT32-relocations-against-ABS-symbols.patch | 53 +++++++++++++++++++
 ...OT32-relocations-against-ABS-symbols.patch | 47 ++++++++++++++++
 3 files changed, 146 insertions(+)
 create mode 100644 package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
 create mode 100644 package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
 create mode 100644 package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch

diff --git a/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
new file mode 100644
index 0000000000..e95eb1e7c5
--- /dev/null
+++ b/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
@@ -0,0 +1,46 @@
+From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 7 Feb 2022 15:22:19 -0800
+Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
+
+GOT32 relocations are allowed since absolute value + addend is stored in
+the GOT slot.
+
+Tested on glibc 2.35 build with GCC 11.2 and -Os.
+
+bfd/
+
+	PR ld/28870
+	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
+	relocations.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
+index 7ac2411fc80..d00dc45677b 100644
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       irel = *rel;
+ 
+       /* Only allow relocations against absolute symbol, which can be
+-	 resolved as absolute value + addend.  GOTPCREL relocations
+-	 are allowed since absolute value + addend is stored in the
+-	 GOT slot.  */
++	 resolved as absolute value + addend.  GOTPCREL and GOT32
++	 relocations are allowed since absolute value + addend is
++	 stored in the GOT slot.  */
+       if (bed->target_id == X86_64_ELF_DATA)
+ 	{
+ 	  r_type &= ~R_X86_64_converted_reloc_bit;
+@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       else
+ 	valid_p = (r_type == R_386_32
+ 		   || r_type == R_386_16
+-		   || r_type == R_386_8);
++		   || r_type == R_386_8
++		   || r_type == R_386_GOT32
++		   || r_type == R_386_GOT32X);
+ 
+       if (valid_p)
+ 	*no_dynreloc_p = true;
diff --git a/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
new file mode 100644
index 0000000000..af96f1a0f0
--- /dev/null
+++ b/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
@@ -0,0 +1,53 @@
+From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 7 Feb 2022 15:22:19 -0800
+Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
+
+GOT32 relocations are allowed since absolute value + addend is stored in
+the GOT slot.
+
+Tested on glibc 2.35 build with GCC 11.2 and -Os.
+
+bfd/
+
+	PR ld/28870
+	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
+	relocations.
+
+ld/
+
+	PR ld/28870
+	* testsuite/ld-i386/i386.exp: Run pr28870.
+	* testsuite/ld-i386/pr28870.d: New file.
+	* testsuite/ld-i386/pr28870.s: Likewise.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
+index 7ac2411fc80..d00dc45677b 100644
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       irel = *rel;
+ 
+       /* Only allow relocations against absolute symbol, which can be
+-	 resolved as absolute value + addend.  GOTPCREL relocations
+-	 are allowed since absolute value + addend is stored in the
+-	 GOT slot.  */
++	 resolved as absolute value + addend.  GOTPCREL and GOT32
++	 relocations are allowed since absolute value + addend is
++	 stored in the GOT slot.  */
+       if (bed->target_id == X86_64_ELF_DATA)
+ 	{
+ 	  r_type &= ~R_X86_64_converted_reloc_bit;
+@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       else
+ 	valid_p = (r_type == R_386_32
+ 		   || r_type == R_386_16
+-		   || r_type == R_386_8);
++		   || r_type == R_386_8
++		   || r_type == R_386_GOT32
++		   || r_type == R_386_GOT32X);
+ 
+       if (valid_p)
+ 	*no_dynreloc_p = true;
diff --git a/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
new file mode 100644
index 0000000000..3e29282261
--- /dev/null
+++ b/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
@@ -0,0 +1,47 @@
+From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 7 Feb 2022 15:22:19 -0800
+Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
+
+GOT32 relocations are allowed since absolute value + addend is stored in
+the GOT slot.
+
+Tested on glibc 2.35 build with GCC 11.2 and -Os.
+
+bfd/
+
+	PR ld/28870
+	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
+	relocations.
+
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
+index 7ac2411fc80..d00dc45677b 100644
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       irel = *rel;
+ 
+       /* Only allow relocations against absolute symbol, which can be
+-	 resolved as absolute value + addend.  GOTPCREL relocations
+-	 are allowed since absolute value + addend is stored in the
+-	 GOT slot.  */
++	 resolved as absolute value + addend.  GOTPCREL and GOT32
++	 relocations are allowed since absolute value + addend is
++	 stored in the GOT slot.  */
+       if (bed->target_id == X86_64_ELF_DATA)
+ 	{
+ 	  r_type &= ~R_X86_64_converted_reloc_bit;
+@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
+       else
+ 	valid_p = (r_type == R_386_32
+ 		   || r_type == R_386_16
+-		   || r_type == R_386_8);
++		   || r_type == R_386_8
++		   || r_type == R_386_GOT32
++		   || r_type == R_386_GOT32X);
+ 
+       if (valid_p)
+ 	*no_dynreloc_p = true;
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86
  2022-02-11 18:06 [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86 Waldemar Brodkorb
@ 2022-02-13 20:45 ` Thomas Petazzoni via buildroot
  2022-02-13 21:00   ` Thomas Petazzoni via buildroot
  2022-02-14 21:06 ` Arnout Vandecappelle
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-02-13 20:45 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Fri, 11 Feb 2022 19:06:51 +0100
Waldemar Brodkorb <wbx@openadk.org> wrote:

> See here:
> https://sourceware.org/bugzilla/show_bug.cgi?id=28870
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

Is this patch also needed for binutils 2.38 ?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86
  2022-02-13 20:45 ` Thomas Petazzoni via buildroot
@ 2022-02-13 21:00   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-02-13 21:00 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Sun, 13 Feb 2022 21:45:01 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Fri, 11 Feb 2022 19:06:51 +0100
> Waldemar Brodkorb <wbx@openadk.org> wrote:
> 
> > See here:
> > https://sourceware.org/bugzilla/show_bug.cgi?id=28870
> > 
> > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>  
> 
> Is this patch also needed for binutils 2.38 ?

No it isn't: it's part of binutils 2.38.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86
  2022-02-11 18:06 [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86 Waldemar Brodkorb
  2022-02-13 20:45 ` Thomas Petazzoni via buildroot
@ 2022-02-14 21:06 ` Arnout Vandecappelle
  1 sibling, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-02-14 21:06 UTC (permalink / raw)
  To: Waldemar Brodkorb, buildroot



On 11/02/2022 19:06, Waldemar Brodkorb wrote:
> See here:
> https://sourceware.org/bugzilla/show_bug.cgi?id=28870
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   ...OT32-relocations-against-ABS-symbols.patch | 46 ++++++++++++++++
>   ...OT32-relocations-against-ABS-symbols.patch | 53 +++++++++++++++++++
>   ...OT32-relocations-against-ABS-symbols.patch | 47 ++++++++++++++++
>   3 files changed, 146 insertions(+)
>   create mode 100644 package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
>   create mode 100644 package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
>   create mode 100644 package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> 
> diff --git a/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> new file mode 100644
> index 0000000000..e95eb1e7c5
> --- /dev/null
> +++ b/package/binutils/2.35.2/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> @@ -0,0 +1,46 @@
> +From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
> +From: "H.J. Lu" <hjl.tools@gmail.com>
> +Date: Mon, 7 Feb 2022 15:22:19 -0800
> +Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
> +
> +GOT32 relocations are allowed since absolute value + addend is stored in
> +the GOT slot.
> +
> +Tested on glibc 2.35 build with GCC 11.2 and -Os.
> +
> +bfd/
> +
> +	PR ld/28870
> +	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
> +	relocations.
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +
> +diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
> +index 7ac2411fc80..d00dc45677b 100644
> +--- a/bfd/elfxx-x86.c
> ++++ b/bfd/elfxx-x86.c
> +@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       irel = *rel;
> +
> +       /* Only allow relocations against absolute symbol, which can be
> +-	 resolved as absolute value + addend.  GOTPCREL relocations
> +-	 are allowed since absolute value + addend is stored in the
> +-	 GOT slot.  */
> ++	 resolved as absolute value + addend.  GOTPCREL and GOT32
> ++	 relocations are allowed since absolute value + addend is
> ++	 stored in the GOT slot.  */
> +       if (bed->target_id == X86_64_ELF_DATA)
> + 	{
> + 	  r_type &= ~R_X86_64_converted_reloc_bit;
> +@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       else
> + 	valid_p = (r_type == R_386_32
> + 		   || r_type == R_386_16
> +-		   || r_type == R_386_8);
> ++		   || r_type == R_386_8
> ++		   || r_type == R_386_GOT32
> ++		   || r_type == R_386_GOT32X);
> +
> +       if (valid_p)
> + 	*no_dynreloc_p = true;
> diff --git a/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> new file mode 100644
> index 0000000000..af96f1a0f0
> --- /dev/null
> +++ b/package/binutils/2.36.1/0010-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> @@ -0,0 +1,53 @@
> +From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
> +From: "H.J. Lu" <hjl.tools@gmail.com>
> +Date: Mon, 7 Feb 2022 15:22:19 -0800
> +Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
> +
> +GOT32 relocations are allowed since absolute value + addend is stored in
> +the GOT slot.
> +
> +Tested on glibc 2.35 build with GCC 11.2 and -Os.
> +
> +bfd/
> +
> +	PR ld/28870
> +	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
> +	relocations.
> +
> +ld/
> +
> +	PR ld/28870
> +	* testsuite/ld-i386/i386.exp: Run pr28870.
> +	* testsuite/ld-i386/pr28870.d: New file.
> +	* testsuite/ld-i386/pr28870.s: Likewise.
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +
> +diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
> +index 7ac2411fc80..d00dc45677b 100644
> +--- a/bfd/elfxx-x86.c
> ++++ b/bfd/elfxx-x86.c
> +@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       irel = *rel;
> +
> +       /* Only allow relocations against absolute symbol, which can be
> +-	 resolved as absolute value + addend.  GOTPCREL relocations
> +-	 are allowed since absolute value + addend is stored in the
> +-	 GOT slot.  */
> ++	 resolved as absolute value + addend.  GOTPCREL and GOT32
> ++	 relocations are allowed since absolute value + addend is
> ++	 stored in the GOT slot.  */
> +       if (bed->target_id == X86_64_ELF_DATA)
> + 	{
> + 	  r_type &= ~R_X86_64_converted_reloc_bit;
> +@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       else
> + 	valid_p = (r_type == R_386_32
> + 		   || r_type == R_386_16
> +-		   || r_type == R_386_8);
> ++		   || r_type == R_386_8
> ++		   || r_type == R_386_GOT32
> ++		   || r_type == R_386_GOT32X);
> +
> +       if (valid_p)
> + 	*no_dynreloc_p = true;
> diff --git a/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch b/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> new file mode 100644
> index 0000000000..3e29282261
> --- /dev/null
> +++ b/package/binutils/2.37/0007-i386-Allow-GOT32-relocations-against-ABS-symbols.patch
> @@ -0,0 +1,47 @@
> +From 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Mon Sep 17 00:00:00 2001
> +From: "H.J. Lu" <hjl.tools@gmail.com>
> +Date: Mon, 7 Feb 2022 15:22:19 -0800
> +Subject: [PATCH] i386: Allow GOT32 relocations against ABS symbols
> +
> +GOT32 relocations are allowed since absolute value + addend is stored in
> +the GOT slot.
> +
> +Tested on glibc 2.35 build with GCC 11.2 and -Os.
> +
> +bfd/
> +
> +	PR ld/28870
> +	* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
> +	relocations.
> +
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +
> +diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
> +index 7ac2411fc80..d00dc45677b 100644
> +--- a/bfd/elfxx-x86.c
> ++++ b/bfd/elfxx-x86.c
> +@@ -1942,9 +1942,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       irel = *rel;
> +
> +       /* Only allow relocations against absolute symbol, which can be
> +-	 resolved as absolute value + addend.  GOTPCREL relocations
> +-	 are allowed since absolute value + addend is stored in the
> +-	 GOT slot.  */
> ++	 resolved as absolute value + addend.  GOTPCREL and GOT32
> ++	 relocations are allowed since absolute value + addend is
> ++	 stored in the GOT slot.  */
> +       if (bed->target_id == X86_64_ELF_DATA)
> + 	{
> + 	  r_type &= ~R_X86_64_converted_reloc_bit;
> +@@ -1965,7 +1965,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
> +       else
> + 	valid_p = (r_type == R_386_32
> + 		   || r_type == R_386_16
> +-		   || r_type == R_386_8);
> ++		   || r_type == R_386_8
> ++		   || r_type == R_386_GOT32
> ++		   || r_type == R_386_GOT32X);
> +
> +       if (valid_p)
> + 	*no_dynreloc_p = true;
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-02-14 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-11 18:06 [Buildroot] [PATCH 1/2] package/binutils: fixes glibc build compiled with -Os on x86 Waldemar Brodkorb
2022-02-13 20:45 ` Thomas Petazzoni via buildroot
2022-02-13 21:00   ` Thomas Petazzoni via buildroot
2022-02-14 21:06 ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox