public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix emit-relocs for aarch64 gold
@ 2023-01-24 13:36 Vladislav Khmelevsky
  0 siblings, 0 replies; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-01-24 13:36 UTC (permalink / raw)
  To: binutils, ccoutant, ikudrin; +Cc: Vladislav Khmelevsky

Fix relocation offsets values for the relaxed input sections the same
way it was fixed for the sections in PR21430.
---
 gold/aarch64.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 46a278bd466..b199fac2af7 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
 			Section_id_hash> AArch64_input_section_map;
   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
   const static int TCB_SIZE = size / 8 * 2;
+  static const Address invalid_address = static_cast<Address> (-1);
 
   Target_aarch64(const Target::Target_info* info = &aarch64_info)
     : Sized_target<size, big_endian>(info),
@@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
 
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
+  if (offset_in_output_section == this->invalid_address)
+    {
+      const Output_relaxed_input_section *poris
+          = output_section->find_relaxed_input_section (relinfo->object,
+                                                        relinfo->data_shndx);
+      if (poris != NULL)
+        {
+          Address section_address = poris->address ();
+          section_size_type section_size = poris->data_size ();
+
+          gold_assert ((section_address >= view_address)
+                       && ((section_address + section_size)
+                           <= (view_address + view_size)));
+
+          off_t offset = section_address - view_address;
+          view += offset;
+          view_address += offset;
+          view_size = section_size;
+        }
+    }
+
   gold::relocate_relocs<size, big_endian, Classify_reloc>(
     relinfo,
     prelocs,
-- 
2.25.1


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

* Re: [PATCH] Fix emit-relocs for aarch64 gold
  2023-11-16 10:35     ` Alan Modra
@ 2023-11-16 15:35       ` Vladislav Khmelevsky
  0 siblings, 0 replies; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-11-16 15:35 UTC (permalink / raw)
  To: Alan Modra; +Cc: Dmitry Selyutin, binutils

Alan, Dmitry thanks for your help. Appreciate that!

> 16 нояб. 2023 г., в 14:35, Alan Modra <amodra@gmail.com> написал(а):
> 
> On Mon, Nov 13, 2023 at 11:15:09AM +0300, Dmitry Selyutin wrote:
>> On Wed, Nov 8, 2023 at 7:37 PM Vladislav Khmelevsky <och95@yandex.ru> wrote:
>>> 
>>> It's been ~10 months I'm trying to submit the patch and no one replied on this even ones..
>>> Is there anything I can do to pay attention to this patch from the highly respected maintainers?
>> 
>> Alan, could you, please, take a look at this patch, or kindly route
>> Vladislav to the right person?
> 
> I've pushed the patch after fixing formatting.  gold sources don't put
> a space before a function call opening parenthesis.
> 
> -- 
> Alan Modra
> Australia Development Lab, IBM


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

* Re: [PATCH] Fix emit-relocs for aarch64 gold
  2023-11-13  8:15   ` Dmitry Selyutin
@ 2023-11-16 10:35     ` Alan Modra
  2023-11-16 15:35       ` Vladislav Khmelevsky
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Modra @ 2023-11-16 10:35 UTC (permalink / raw)
  To: Dmitry Selyutin; +Cc: binutils, Vladislav Khmelevsky

On Mon, Nov 13, 2023 at 11:15:09AM +0300, Dmitry Selyutin wrote:
> On Wed, Nov 8, 2023 at 7:37 PM Vladislav Khmelevsky <och95@yandex.ru> wrote:
> >
> > It's been ~10 months I'm trying to submit the patch and no one replied on this even ones..
> > Is there anything I can do to pay attention to this patch from the highly respected maintainers?
> 
> Alan, could you, please, take a look at this patch, or kindly route
> Vladislav to the right person?

I've pushed the patch after fixing formatting.  gold sources don't put
a space before a function call opening parenthesis.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: [PATCH] Fix emit-relocs for aarch64 gold
  2023-11-08 16:36 ` Vladislav Khmelevsky
@ 2023-11-13  8:15   ` Dmitry Selyutin
  2023-11-16 10:35     ` Alan Modra
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Selyutin @ 2023-11-13  8:15 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Vladislav Khmelevsky

On Wed, Nov 8, 2023 at 7:37 PM Vladislav Khmelevsky <och95@yandex.ru> wrote:
>
> It's been ~10 months I'm trying to submit the patch and no one replied on this even ones..
> Is there anything I can do to pay attention to this patch from the highly respected maintainers?

Alan, could you, please, take a look at this patch, or kindly route
Vladislav to the right person?

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

* Re: [PATCH] Fix emit-relocs for aarch64 gold
  2023-11-08 16:26 Vladislav Khmelevsky
@ 2023-11-08 16:36 ` Vladislav Khmelevsky
  2023-11-13  8:15   ` Dmitry Selyutin
  0 siblings, 1 reply; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-11-08 16:36 UTC (permalink / raw)
  To: binutils

It's been ~10 months I'm trying to submit the patch and no one replied on this even ones.. 
Is there anything I can do to pay attention to this patch from the highly respected maintainers?

> 8 нояб. 2023 г., в 20:26, Vladislav Khmelevsky <och95@yandex.ru> написал(а):
> 
> Fix relocation offsets values for the relaxed input sections the same
> way it was fixed for the sections in PR21430.
> ---
> gold/aarch64.cc | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
> 
> diff --git a/gold/aarch64.cc b/gold/aarch64.cc
> index 46a278bd466..b199fac2af7 100644
> --- a/gold/aarch64.cc
> +++ b/gold/aarch64.cc
> @@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
> 			Section_id_hash> AArch64_input_section_map;
>   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
>   const static int TCB_SIZE = size / 8 * 2;
> +  static const Address invalid_address = static_cast<Address> (-1);
> 
>   Target_aarch64(const Target::Target_info* info = &aarch64_info)
>     : Sized_target<size, big_endian>(info),
> @@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
> 
>   gold_assert(sh_type == elfcpp::SHT_RELA);
> 
> +  if (offset_in_output_section == this->invalid_address)
> +    {
> +      const Output_relaxed_input_section *poris
> +          = output_section->find_relaxed_input_section (relinfo->object,
> +                                                        relinfo->data_shndx);
> +      if (poris != NULL)
> +        {
> +          Address section_address = poris->address ();
> +          section_size_type section_size = poris->data_size ();
> +
> +          gold_assert ((section_address >= view_address)
> +                       && ((section_address + section_size)
> +                           <= (view_address + view_size)));
> +
> +          off_t offset = section_address - view_address;
> +          view += offset;
> +          view_address += offset;
> +          view_size = section_size;
> +        }
> +    }
> +
>   gold::relocate_relocs<size, big_endian, Classify_reloc>(
>     relinfo,
>     prelocs,
> -- 
> 2.25.1
> 


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

* [PATCH] Fix emit-relocs for aarch64 gold
@ 2023-11-08 16:26 Vladislav Khmelevsky
  2023-11-08 16:36 ` Vladislav Khmelevsky
  0 siblings, 1 reply; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-11-08 16:26 UTC (permalink / raw)
  To: binutils; +Cc: Vladislav Khmelevsky

Fix relocation offsets values for the relaxed input sections the same
way it was fixed for the sections in PR21430.
---
 gold/aarch64.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 46a278bd466..b199fac2af7 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
 			Section_id_hash> AArch64_input_section_map;
   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
   const static int TCB_SIZE = size / 8 * 2;
+  static const Address invalid_address = static_cast<Address> (-1);
 
   Target_aarch64(const Target::Target_info* info = &aarch64_info)
     : Sized_target<size, big_endian>(info),
@@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
 
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
+  if (offset_in_output_section == this->invalid_address)
+    {
+      const Output_relaxed_input_section *poris
+          = output_section->find_relaxed_input_section (relinfo->object,
+                                                        relinfo->data_shndx);
+      if (poris != NULL)
+        {
+          Address section_address = poris->address ();
+          section_size_type section_size = poris->data_size ();
+
+          gold_assert ((section_address >= view_address)
+                       && ((section_address + section_size)
+                           <= (view_address + view_size)));
+
+          off_t offset = section_address - view_address;
+          view += offset;
+          view_address += offset;
+          view_size = section_size;
+        }
+    }
+
   gold::relocate_relocs<size, big_endian, Classify_reloc>(
     relinfo,
     prelocs,
-- 
2.25.1


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

* [PATCH] Fix emit-relocs for aarch64 gold
@ 2023-09-18 10:53 Vladislav Khmelevsky
  0 siblings, 0 replies; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-09-18 10:53 UTC (permalink / raw)
  To: binutils; +Cc: Vladislav Khmelevsky

Fix relocation offsets values for the relaxed input sections the same
way it was fixed for the sections in PR21430.
---
 gold/aarch64.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 46a278bd466..b199fac2af7 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
 			Section_id_hash> AArch64_input_section_map;
   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
   const static int TCB_SIZE = size / 8 * 2;
+  static const Address invalid_address = static_cast<Address> (-1);
 
   Target_aarch64(const Target::Target_info* info = &aarch64_info)
     : Sized_target<size, big_endian>(info),
@@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
 
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
+  if (offset_in_output_section == this->invalid_address)
+    {
+      const Output_relaxed_input_section *poris
+          = output_section->find_relaxed_input_section (relinfo->object,
+                                                        relinfo->data_shndx);
+      if (poris != NULL)
+        {
+          Address section_address = poris->address ();
+          section_size_type section_size = poris->data_size ();
+
+          gold_assert ((section_address >= view_address)
+                       && ((section_address + section_size)
+                           <= (view_address + view_size)));
+
+          off_t offset = section_address - view_address;
+          view += offset;
+          view_address += offset;
+          view_size = section_size;
+        }
+    }
+
   gold::relocate_relocs<size, big_endian, Classify_reloc>(
     relinfo,
     prelocs,
-- 
2.25.1


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

* [PATCH] Fix emit-relocs for aarch64 gold
@ 2023-04-23 17:30 Vladislav Khmelevsky
  0 siblings, 0 replies; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-04-23 17:30 UTC (permalink / raw)
  To: binutils; +Cc: Vladislav Khmelevsky

Fix relocation offsets values for the relaxed input sections the same
way it was fixed for the sections in PR21430.
---
 gold/aarch64.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 46a278bd466..b199fac2af7 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
 			Section_id_hash> AArch64_input_section_map;
   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
   const static int TCB_SIZE = size / 8 * 2;
+  static const Address invalid_address = static_cast<Address> (-1);
 
   Target_aarch64(const Target::Target_info* info = &aarch64_info)
     : Sized_target<size, big_endian>(info),
@@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
 
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
+  if (offset_in_output_section == this->invalid_address)
+    {
+      const Output_relaxed_input_section *poris
+          = output_section->find_relaxed_input_section (relinfo->object,
+                                                        relinfo->data_shndx);
+      if (poris != NULL)
+        {
+          Address section_address = poris->address ();
+          section_size_type section_size = poris->data_size ();
+
+          gold_assert ((section_address >= view_address)
+                       && ((section_address + section_size)
+                           <= (view_address + view_size)));
+
+          off_t offset = section_address - view_address;
+          view += offset;
+          view_address += offset;
+          view_size = section_size;
+        }
+    }
+
   gold::relocate_relocs<size, big_endian, Classify_reloc>(
     relinfo,
     prelocs,
-- 
2.25.1


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

* [PATCH] Fix emit-relocs for aarch64 gold
@ 2023-03-13 10:22 Vladislav Khmelevsky
  0 siblings, 0 replies; 9+ messages in thread
From: Vladislav Khmelevsky @ 2023-03-13 10:22 UTC (permalink / raw)
  To: binutils, ccoutant; +Cc: Vladislav Khmelevsky

Fix relocation offsets values for the relaxed input sections the same
way it was fixed for the sections in PR21430.
---
 gold/aarch64.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 46a278bd466..b199fac2af7 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2916,6 +2916,7 @@ class Target_aarch64 : public Sized_target<size, big_endian>
 			Section_id_hash> AArch64_input_section_map;
   typedef AArch64_insn_utilities<big_endian> Insn_utilities;
   const static int TCB_SIZE = size / 8 * 2;
+  static const Address invalid_address = static_cast<Address> (-1);
 
   Target_aarch64(const Target::Target_info* info = &aarch64_info)
     : Sized_target<size, big_endian>(info),
@@ -8286,6 +8287,27 @@ Target_aarch64<size, big_endian>::relocate_relocs(
 
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
+  if (offset_in_output_section == this->invalid_address)
+    {
+      const Output_relaxed_input_section *poris
+          = output_section->find_relaxed_input_section (relinfo->object,
+                                                        relinfo->data_shndx);
+      if (poris != NULL)
+        {
+          Address section_address = poris->address ();
+          section_size_type section_size = poris->data_size ();
+
+          gold_assert ((section_address >= view_address)
+                       && ((section_address + section_size)
+                           <= (view_address + view_size)));
+
+          off_t offset = section_address - view_address;
+          view += offset;
+          view_address += offset;
+          view_size = section_size;
+        }
+    }
+
   gold::relocate_relocs<size, big_endian, Classify_reloc>(
     relinfo,
     prelocs,
-- 
2.25.1


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

end of thread, other threads:[~2023-11-16 15:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 13:36 [PATCH] Fix emit-relocs for aarch64 gold Vladislav Khmelevsky
2023-03-13 10:22 Vladislav Khmelevsky
2023-04-23 17:30 Vladislav Khmelevsky
2023-09-18 10:53 Vladislav Khmelevsky
2023-11-08 16:26 Vladislav Khmelevsky
2023-11-08 16:36 ` Vladislav Khmelevsky
2023-11-13  8:15   ` Dmitry Selyutin
2023-11-16 10:35     ` Alan Modra
2023-11-16 15:35       ` Vladislav Khmelevsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).