* [PATCH] Set the sh_entsize field of .stab to 12
@ 2020-04-03 4:58 Fangrui Song
2020-04-03 5:15 ` Alan Modra
0 siblings, 1 reply; 7+ messages in thread
From: Fangrui Song @ 2020-04-03 4:58 UTC (permalink / raw)
To: binutils; +Cc: Fangrui Song
---
bfd/ChangeLog | 4 ++++
bfd/elf.c | 4 +---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 64c3dde475..90e19b8612 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-02 Fangrui Song <maskray@google.com>
+
+ * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
+
2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
* bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
diff --git a/bfd/elf.c b/bfd/elf.c
index 86dadea05c..0c550bdadf 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3998,9 +3998,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
elf_section_data (s)->this_hdr.sh_link = d->this_idx;
/* This is a .stab section. */
- if (elf_section_data (s)->this_hdr.sh_entsize == 0)
- elf_section_data (s)->this_hdr.sh_entsize
- = 4 + 2 * bfd_get_arch_size (abfd) / 8;
+ elf_section_data (s)->this_hdr.sh_entsize = 12;
}
}
break;
--
2.26.0.292.g33ef6b2f38-goog
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Set the sh_entsize field of .stab to 12
2020-04-03 4:58 [PATCH] Set the sh_entsize field of .stab to 12 Fangrui Song
@ 2020-04-03 5:15 ` Alan Modra
2020-04-03 6:03 ` [PATCH v2] " Fangrui Song
0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2020-04-03 5:15 UTC (permalink / raw)
To: Fangrui Song; +Cc: binutils
On Thu, Apr 02, 2020 at 09:58:43PM -0700, Fangrui Song via Binutils wrote:
> ---
> bfd/ChangeLog | 4 ++++
> bfd/elf.c | 4 +---
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/bfd/ChangeLog b/bfd/ChangeLog
> index 64c3dde475..90e19b8612 100644
> --- a/bfd/ChangeLog
> +++ b/bfd/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-04-02 Fangrui Song <maskray@google.com>
> +
> + * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
> +
> 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
OK. Please justify the patch when posting and in the git log.
"Only 32-bit stabs are supported" would do.
> * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
> diff --git a/bfd/elf.c b/bfd/elf.c
> index 86dadea05c..0c550bdadf 100644
> --- a/bfd/elf.c
> +++ b/bfd/elf.c
> @@ -3998,9 +3998,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
> elf_section_data (s)->this_hdr.sh_link = d->this_idx;
>
> /* This is a .stab section. */
> - if (elf_section_data (s)->this_hdr.sh_entsize == 0)
> - elf_section_data (s)->this_hdr.sh_entsize
> - = 4 + 2 * bfd_get_arch_size (abfd) / 8;
> + elf_section_data (s)->this_hdr.sh_entsize = 12;
> }
> }
> break;
> --
> 2.26.0.292.g33ef6b2f38-goog
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] Set the sh_entsize field of .stab to 12
2020-04-03 5:15 ` Alan Modra
@ 2020-04-03 6:03 ` Fangrui Song
2020-04-08 22:00 ` Fangrui Song
0 siblings, 1 reply; 7+ messages in thread
From: Fangrui Song @ 2020-04-03 6:03 UTC (permalink / raw)
To: binutils; +Cc: Fangrui Song
The existing code assumes sh_entsize(.stab)=20 on ELFCLASS64.
However, the assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
PR gas/25768
* elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
---
bfd/ChangeLog | 5 +++++
bfd/elf.c | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 64c3dde475..47b8e566ef 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-02 Fangrui Song <maskray@google.com>
+
+ PR gas/25768
+ * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
+
2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
* bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
diff --git a/bfd/elf.c b/bfd/elf.c
index 86dadea05c..0c550bdadf 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3998,9 +3998,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
elf_section_data (s)->this_hdr.sh_link = d->this_idx;
/* This is a .stab section. */
- if (elf_section_data (s)->this_hdr.sh_entsize == 0)
- elf_section_data (s)->this_hdr.sh_entsize
- = 4 + 2 * bfd_get_arch_size (abfd) / 8;
+ elf_section_data (s)->this_hdr.sh_entsize = 12;
}
}
break;
--
2.26.0.292.g33ef6b2f38-goog
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Set the sh_entsize field of .stab to 12
2020-04-03 6:03 ` [PATCH v2] " Fangrui Song
@ 2020-04-08 22:00 ` Fangrui Song
2020-04-09 10:24 ` Nick Clifton
0 siblings, 1 reply; 7+ messages in thread
From: Fangrui Song @ 2020-04-08 22:00 UTC (permalink / raw)
To: binutils
On 2020-04-02, Fangrui Song wrote:
>The existing code assumes sh_entsize(.stab)=20 on ELFCLASS64.
>However, the assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
>
> PR gas/25768
> * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
>---
> bfd/ChangeLog | 5 +++++
> bfd/elf.c | 4 +---
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/bfd/ChangeLog b/bfd/ChangeLog
>index 64c3dde475..47b8e566ef 100644
>--- a/bfd/ChangeLog
>+++ b/bfd/ChangeLog
>@@ -1,3 +1,8 @@
>+2020-04-02 Fangrui Song <maskray@google.com>
>+
>+ PR gas/25768
>+ * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
>+
> 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
>
> * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
>diff --git a/bfd/elf.c b/bfd/elf.c
>index 86dadea05c..0c550bdadf 100644
>--- a/bfd/elf.c
>+++ b/bfd/elf.c
>@@ -3998,9 +3998,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
> elf_section_data (s)->this_hdr.sh_link = d->this_idx;
>
> /* This is a .stab section. */
>- if (elf_section_data (s)->this_hdr.sh_entsize == 0)
>- elf_section_data (s)->this_hdr.sh_entsize
>- = 4 + 2 * bfd_get_arch_size (abfd) / 8;
>+ elf_section_data (s)->this_hdr.sh_entsize = 12;
> }
> }
> break;
>--
>2.26.0.292.g33ef6b2f38-goog
>
Ping :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Set the sh_entsize field of .stab to 12
2020-04-08 22:00 ` Fangrui Song
@ 2020-04-09 10:24 ` Nick Clifton
2020-04-09 15:37 ` Fangrui Song
0 siblings, 1 reply; 7+ messages in thread
From: Nick Clifton @ 2020-04-09 10:24 UTC (permalink / raw)
To: Fangrui Song, binutils
Hi Fangrui,
>> PR gas/25768
>> * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
Approved - please apply.
> Ping :)
Sorry - I blame the weather - or aliens - or anything but my own laziness.
Cheers
Nick
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Set the sh_entsize field of .stab to 12
2020-04-09 10:24 ` Nick Clifton
@ 2020-04-09 15:37 ` Fangrui Song
2020-04-14 14:23 ` Nick Clifton
0 siblings, 1 reply; 7+ messages in thread
From: Fangrui Song @ 2020-04-09 15:37 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
On 2020-04-09, Nick Clifton wrote:
>Hi Fangrui,
>
>>> PR gas/25768
>>> * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
>
>Approved - please apply.
>
>> Ping :)
>
>Sorry - I blame the weather - or aliens - or anything but my own laziness.
>
>Cheers
> Nick
No worries! Nick, can you apply it on my behalf? I don't have a commit bit.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Set the sh_entsize field of .stab to 12
2020-04-09 15:37 ` Fangrui Song
@ 2020-04-14 14:23 ` Nick Clifton
0 siblings, 0 replies; 7+ messages in thread
From: Nick Clifton @ 2020-04-14 14:23 UTC (permalink / raw)
To: Fangrui Song; +Cc: binutils
Hi Fangrui,
>>>> PR gas/25768
>>>> * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
>>
>> Approved - please apply.
> No worries! Nick, can you apply it on my behalf? I don't have a commit bit.
Applied.
Cheers
Nick
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-04-14 14:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 4:58 [PATCH] Set the sh_entsize field of .stab to 12 Fangrui Song
2020-04-03 5:15 ` Alan Modra
2020-04-03 6:03 ` [PATCH v2] " Fangrui Song
2020-04-08 22:00 ` Fangrui Song
2020-04-09 10:24 ` Nick Clifton
2020-04-09 15:37 ` Fangrui Song
2020-04-14 14:23 ` Nick Clifton
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).