From: Alan Modra Date: Fri, 23 Jan 2026 23:22:40 +0000 (+1030) Subject: gas: move obj_begin earlier X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6768cc8eb7a06f7a00b8db924cf9ddb2d65059;p=thirdparty%2Fbinutils-gdb.git 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 --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