llvm-strip on mips fails with error: symbol 'stdout' has unsupported value greater than or equal to SHN_LORESERVE: 65283
Attached testcase fails llvm-strip where as GNU strip works ok.
mips-yoe-linux-llvm-strip purgatory/purgatory.ro.sym
../recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-llvm-strip: error: symbol 'stdout' has unsupported value greater than or equal to SHN_LORESERVE: 65283
@llvm/issue-subscribers-backend-mips
@llvm/issue-subscribers-tools-llvm-objcopy-strip
SHN_MIPS_SCOMMON is 0xff03. https://refspecs.linuxfoundation.org/elf/mipsabi.pdf (I do not know which ABI is more appropriate) says:
SHN_MIPS_SCOMMON - Symbols defined relative to this section are common symbols which can be placed in the global
data area (are gp-addressable). See "Global Data Area" in this chapter.
Clang never emits SHN_MIPS_SCOMMON. For GCC, does -fno-common help? https://gcc.gnu.org/gcc-10/changes.html defaults to -fno-common.
SHN_MIPS_SCOMMON is 0xff03. https://refspecs.linuxfoundation.org/elf/mipsabi.pdf (I do not know which ABI is more appropriate) says:
SHN_MIPS_SCOMMON - Symbols defined relative to this section are common symbols which can be placed in the global data area (are gp-addressable). See "Global Data Area" in this chapter.Clang never emits
SHN_MIPS_SCOMMON. For GCC, does-fno-commonhelp? https://gcc.gnu.org/gcc-10/changes.html defaults to -fno-common.
its using clang with -fcommon to generate this binary.
I imagine this is simply a case of handling the specual value like SHN_COMMON and SHN_ABS symbols, if the machine type is MIPS. Is that the case? If so, someone could add the good-first-bug tag as I think it'll be easy enough for a new developer to pick this one up, based on this.
@llvm/issue-subscribers-good-first-issue
I submitted a patch here: https://reviews.llvm.org/D123902