From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79086 invoked by alias); 3 May 2018 17:01:55 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 79036 invoked by uid 89); 3 May 2018 17:01:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.2 spammy=moreover, Table, 1072, Specification X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 May 2018 17:01:52 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] BFD: Prevent writing the MIPS _gp_disp symbol into symbol tables From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <3be08ea4728b56d35e136af4e6fd3086ade17764@gdb-build> Date: Thu, 03 May 2018 17:01:00 -0000 X-SW-Source: 2018-q2/txt/msg03158.txt.bz2 *** TEST RESULTS FOR COMMIT 3be08ea4728b56d35e136af4e6fd3086ade17764 *** Author: Simon Atanasyan Branch: master Commit: 3be08ea4728b56d35e136af4e6fd3086ade17764 BFD: Prevent writing the MIPS _gp_disp symbol into symbol tables The _gp_disp is a magic symbol, always implicitly defined by the linker. It does not make a sense to write it into symbol tables for output files. Moreover, now if the linker gets a version script, the _gp_disp symbol gets zero version definition index. The zero index means[1]: "The symbol is local, not available outside the object." But the _gp_disp symbol has GLOBAL binding. That confuses some tools like for example the LLD linker when they get such files as inputs. This patch fixes the problem - it prevents writing the _gp_disp symbol in regular and dynamic symbol tables. This was tested by running LD test suite on a mipsel-linux board. References: [1] "Linux Standard Base Specification", Section "10.7.2 Symbol Version Table", p. 32 2018-05-03 Simon Atanasyan bfd/ * elf32-mips.c: (elf32_mips_fixup_symbol): New function. (elf_backend_fixup_symbol): New macro. * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp handling. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. ld/ * testsuite/ld-mips-elf/gp-disp-sym.d: New test. * testsuite/ld-mips-elf/gp-disp-sym.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new test. * testsuite/ld-mips-elf/mips16-pic-2.ad: Update for _gp_disp symbol removal. * testsuite/ld-mips-elf/mips16-pic-2.nd: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-3a.dd: Likewise. * testsuite/ld-mips-elf/tlslib-o32-hidden.got: Likewise. * testsuite/ld-mips-elf/tlslib-o32-ver.got: Likewise. * testsuite/ld-mips-elf/tlslib-o32.got: Likewise.