https://sourceware.org/bugzilla/show_bug.cgi?id=30277
Bug ID: 30277 Summary: GNU as produce '.symtab' entries with incorrect order for 32-bit MIPS target Product: binutils Version: 2.40 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gas Assignee: unassigned at sourceware dot org Reporter: msl0000023508 at gmail dot com Target Milestone: --- I have written a simple assembly code to test this issue: $ cat sym-order-test.s .text .global func2, func4, func6 func1: nop func2: nop func3: nop func4: nop func5: nop func6: nop func7: nop $ mips64-none-elfabi64-as -mabi=32 sym-order-test.s -o sym-order-test.o $ readelf --symbols sym-order-test.o Symbol table '.symtab' contains 15 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 SECTION LOCAL DEFAULT 1 .text 2: 00000000 0 SECTION LOCAL DEFAULT 2 .data 3: 00000000 0 SECTION LOCAL DEFAULT 3 .bss 4: 00000000 0 SECTION LOCAL DEFAULT 4 .reginfo 5: 00000000 0 SECTION LOCAL DEFAULT 5 .MIPS.abiflags 6: 00000000 0 SECTION LOCAL DEFAULT 6 .pdr 7: 00000000 0 SECTION LOCAL DEFAULT 7 .gnu.attributes 8: 00000004 0 NOTYPE GLOBAL DEFAULT 1 func2 9: 0000000c 0 NOTYPE GLOBAL DEFAULT 1 func4 10: 00000014 0 NOTYPE GLOBAL DEFAULT 1 func6 11: 00000000 0 NOTYPE LOCAL DEFAULT 1 func1 12: 00000008 0 NOTYPE LOCAL DEFAULT 1 func3 13: 00000010 0 NOTYPE LOCAL DEFAULT 1 func5 14: 00000018 0 NOTYPE LOCAL DEFAULT 1 func7 $ mips64-none-elfabi64-as --version GNU assembler (GNU Binutils) 2.40 Copyright (C) 2023 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `mips64-none-elfabi64'. As shown by readelf(1), there are some LOCAL symbols follow the last GLOBAL symbol, this is not allowed by ELF specification. This issue was raised by ld(1), which rejects the problematical object file under some conditions: $ mips64-none-elfabi64-ld -m elf32btsmip sym-order-test.o mips64-none-elfabi64-ld: sym-order-test.o: .symtab local symbol at index 11 (>= sh_info of 8) mips64-none-elfabi64-ld: sym-order-test.o: error adding symbols: bad value -- You are receiving this mail because: You are on the CC list for the bug.