[03/22] RISC-V: drop .bss override

Message ID aada12dc-7679-4dd3-97be-a8f429020c90@suse.com
State New
Headers
Series ELF: correct handling of simplified section directives |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Jan Beulich Dec. 15, 2023, 12:07 p.m. UTC
  It doesn't look to be a good idea to override the custom handler that
ELF has; afaict doing so broke .previous, and a sub-section specifier
wasn't accepted either.
  

Comments

Nelson Chu Dec. 21, 2023, 6:44 a.m. UTC | #1
I passed the regressions of riscv-gnu-toolchain, so if no one objects, then
it seems safe to commit.

Thanks
Nelson


On Fri, Dec 15, 2023 at 8:07 PM Jan Beulich <jbeulich@suse.com> wrote:

> It doesn't look to be a good idea to override the custom handler that
> ELF has; afaict doing so broke .previous, and a sub-section specifier
> wasn't accepted either.
>
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -4471,15 +4471,6 @@ s_dtprel (int bytes)
>    demand_empty_rest_of_line ();
>  }
>
> -/* Handle the .bss pseudo-op.  */
> -
> -static void
> -s_bss (int ignore ATTRIBUTE_UNUSED)
> -{
> -  subseg_set (bss_section, 0);
> -  demand_empty_rest_of_line ();
> -}
> -
>  static void
>  riscv_make_nops (char *buf, bfd_vma bytes)
>  {
> @@ -5202,7 +5193,6 @@ static const pseudo_typeS riscv_pseudo_t
>    {"dword", cons, 8},
>    {"dtprelword", s_dtprel, 4},
>    {"dtpreldword", s_dtprel, 8},
> -  {"bss", s_bss, 0},
>    {"uleb128", s_riscv_leb128, 0},
>    {"sleb128", s_riscv_leb128, 1},
>    {"insn", s_riscv_insn, 0},
> --- a/gas/doc/c-riscv.texi
> +++ b/gas/doc/c-riscv.texi
> @@ -138,10 +138,6 @@ Emits a DTP-relative word (or double-wor
>  meant to be used by the compiler in shared libraries for DWARF debug info
> for
>  thread local variables.
>
> -@cindex BSS directive
> -@item .bss
> -Sets the current section to the BSS section.
> -
>  @cindex LEB128 directives
>  @item .uleb128 @var{value}
>  @itemx .sleb128 @var{value}
>
>
  

Patch

--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -4471,15 +4471,6 @@  s_dtprel (int bytes)
   demand_empty_rest_of_line ();
 }
 
-/* Handle the .bss pseudo-op.  */
-
-static void
-s_bss (int ignore ATTRIBUTE_UNUSED)
-{
-  subseg_set (bss_section, 0);
-  demand_empty_rest_of_line ();
-}
-
 static void
 riscv_make_nops (char *buf, bfd_vma bytes)
 {
@@ -5202,7 +5193,6 @@  static const pseudo_typeS riscv_pseudo_t
   {"dword", cons, 8},
   {"dtprelword", s_dtprel, 4},
   {"dtpreldword", s_dtprel, 8},
-  {"bss", s_bss, 0},
   {"uleb128", s_riscv_leb128, 0},
   {"sleb128", s_riscv_leb128, 1},
   {"insn", s_riscv_insn, 0},
--- a/gas/doc/c-riscv.texi
+++ b/gas/doc/c-riscv.texi
@@ -138,10 +138,6 @@  Emits a DTP-relative word (or double-wor
 meant to be used by the compiler in shared libraries for DWARF debug info for
 thread local variables.
 
-@cindex BSS directive
-@item .bss
-Sets the current section to the BSS section.
-
 @cindex LEB128 directives
 @item .uleb128 @var{value}
 @itemx .sleb128 @var{value}