[binutils-gdb] gas: move obj_begin earlier

Alan Modra amodra@sourceware.org
Sat Jan 24 00:14:37 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=db6768cc8eb7a06f7a00b8db924cf9ddb2d65059

commit db6768cc8eb7a06f7a00b8db924cf9ddb2d65059
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Jan 24 09:52:40 2026 +1030

    gas: move obj_begin earlier
    
    csky wants to set up ELF object attributes in its md_begin.
    
            * as.c (perform_an_assembly_pass): Move obj_begin earlier.
            * testsuite/gas/mmix/builtin1.d,
            * testsuite/gas/mmix/builtin3.d: Adjust expected output.

Diff:
---
 gas/as.c                          | 8 ++++----
 gas/testsuite/gas/mmix/builtin1.d | 2 +-
 gas/testsuite/gas/mmix/builtin3.d | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gas/as.c b/gas/as.c
index 6492bf1351f..f08c7c71d73 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1266,16 +1266,16 @@ perform_an_assembly_pass (int argc, char ** argv)
   if (strstr (BFD_VERSION_STRING, "." XSTRING (BFD_VERSION_DATE)) != NULL)
     predefine_symbol ("date", BFD_VERSION_DATE);
 
+#ifdef obj_begin
+  obj_begin ();
+#endif
+
   /* This may add symbol table entries, which requires having an open BFD,
      and sections already created.  */
   md_begin ();
-
 #ifdef USING_CGEN
   gas_cgen_begin ();
 #endif
-#ifdef obj_begin
-  obj_begin ();
-#endif
 
   /* Skip argv[0].  */
   argv++;
diff --git a/gas/testsuite/gas/mmix/builtin1.d b/gas/testsuite/gas/mmix/builtin1.d
index 17d13bbfa68..c03a287a401 100644
--- a/gas/testsuite/gas/mmix/builtin1.d
+++ b/gas/testsuite/gas/mmix/builtin1.d
@@ -6,10 +6,10 @@
 .*:     file format elf64-mmix
 
 SYMBOL TABLE:
-0+14 l       \*ABS\*	0+ rJ
 0+ l    d  \.text	0+ (|\.text)
 0+ l    d  \.data	0+ (|\.data)
 0+ l    d  \.bss	0+ (|\.bss)
+0+14 l       \*ABS\*	0+ rJ
 0+ g     F \.text	0+ Main
 
 
diff --git a/gas/testsuite/gas/mmix/builtin3.d b/gas/testsuite/gas/mmix/builtin3.d
index 74801a6d548..29455374db6 100644
--- a/gas/testsuite/gas/mmix/builtin3.d
+++ b/gas/testsuite/gas/mmix/builtin3.d
@@ -8,10 +8,10 @@
 .*:     file format elf64-mmix
 
 SYMBOL TABLE:
-0+14 l       \*ABS\*	0+ rJ
 0+ l    d  \.text	0+ (|\.text)
 0+ l    d  \.data	0+ (|\.data)
 0+ l    d  \.bss	0+ (|\.bss)
+0+14 l       \*ABS\*	0+ rJ
 0+ g     F \.text	0+ Main


More information about the Binutils-cvs mailing list