]> git.ozlabs.org Git - patchwork/blob - apps/patchwork/tests/mail/0007-cvs-format-diff.mbox
tox: Add tox.ini file
[patchwork] / apps / patchwork / tests / mail / 0007-cvs-format-diff.mbox
1 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 06 Dec 2011 01:49:42 +0100 (CET)
2 Received: from mail3.caviumnetworks.com ([12.108.191.235]:14337 "EHLO
3         mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK)
4         by eddie.linux-mips.org with ESMTP id S1903632Ab1LFAth (ORCPT
5         <rfc822;linux-mips@linux-mips.org>); Tue, 6 Dec 2011 01:49:37 +0100
6 Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by mail3.caviumnetworks.com with MailMarshal (v6,7,2,8378)
7         id <B4edd66f80000>; Mon, 05 Dec 2011 16:51:04 -0800
8 Received: from caexch01.caveonetworks.com ([192.168.16.9]) by caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.4675);
9          Mon, 5 Dec 2011 16:49:36 -0800
10 Received: from dd1.caveonetworks.com ([64.2.3.195]) by caexch01.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675);
11          Mon, 5 Dec 2011 16:49:35 -0800
12 Message-ID: <4EDD669F.30207@cavium.com>
13 Date:   Mon, 05 Dec 2011 16:49:35 -0800
14 From:   David Daney <david.daney@cavium.com>
15 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
16 MIME-Version: 1.0
17 To:     binutils <binutils@sourceware.org>
18 CC:     linux-mips <linux-mips@linux-mips.org>,
19         Manuel Lauss <manuel.lauss@googlemail.com>,
20         Debian MIPS <debian-mips@lists.debian.org>
21 Subject: [Patch]: Fix ld pr11138 FAILures on mips*.
22 Content-Type: multipart/mixed;
23  boundary="------------080709040708040308010506"
24 X-OriginalArrivalTime: 06 Dec 2011 00:49:35.0825 (UTC) FILETIME=[ECF8DC10:01CCB3B0]
25 Return-Path: <David.Daney@caviumnetworks.com>
26 X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
27 X-Orcpt: rfc822;linux-mips@linux-mips.org
28 Original-Recipient: rfc822;linux-mips@linux-mips.org
29 X-archive-position: 32041
30 X-ecartis-version: Ecartis v1.0.0
31 Sender: linux-mips-bounce@linux-mips.org
32 Errors-to: linux-mips-bounce@linux-mips.org
33 X-original-sender: david.daney@cavium.com
34 Precedence: bulk
35 X-list: linux-mips
36
37 This is a multi-part message in MIME format.
38 --------------080709040708040308010506
39 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
40 Content-Transfer-Encoding: 7bit
41
42 The pr11138 testcase links an executable with a version script.  On 
43 mips64-linux the presence of a version script was causing the 
44 MIPS_RLD_MAP dynamic tag to be populated with a NULL value.  When such 
45 an executable was run ld.so would try to dereference this and receive 
46 SIGSEGV, thus killing the process.
47
48 The root cause of this is that the mips linker synthesizes a special 
49 symbol "__RLD_MAP", and then sets MIPS_RLD_MAP to point to it.  When a 
50 version script is present, this symbol gets versioned along with all the 
51 rest, and when it is time to take its address, the symbol can no longer 
52 be found as it has had version information appended to its name.
53
54 Since "__RLD_MAP" is really part of the ABI, we want to exclude it from 
55 symbol versioning.  To this end, I introduced a new symbol flag 
56 'no_sym_version' to tag this type of symbol.  When the "__RLD_MAP" 
57 symbol is created, we set this flag.
58
59 In _bfd_elf_link_assign_sym_version, we then skip all symbols that have 
60 'no_sym_version' set, and everything now works.
61
62 This problem has also been reported in the wild when linking the firefox 
63 executable.
64
65 Tested on mips64-linux-gnu and x86_64-linux-gnu
66
67 Ok to commit?
68
69 2011-12-05  David Daney  <david.daney@cavium.com>
70
71         * elf-bfd.h (elf_link_hash_entry): Add no_sym_version field.
72         * elflink.c (_bfd_elf_link_assign_sym_version): Don't assign a
73         version if no_sym_version is set.
74         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
75         no_sym_version for "__RLD_MAP".
76
77 --------------080709040708040308010506
78 Content-Type: text/plain;
79  name="dd-2.patch"
80 Content-Transfer-Encoding: 7bit
81 Content-Disposition: attachment;
82  filename="dd-2.patch"
83
84 Index: bfd/elf-bfd.h
85 ===================================================================
86 RCS file: /cvs/src/src/bfd/elf-bfd.h,v
87 retrieving revision 1.329
88 diff -u -p -r1.329 elf-bfd.h
89 --- bfd/elf-bfd.h       17 Aug 2011 00:39:38 -0000      1.329
90 +++ bfd/elf-bfd.h       5 Dec 2011 20:15:49 -0000
91 @@ -198,6 +198,8 @@ struct elf_link_hash_entry
92    unsigned int pointer_equality_needed : 1;
93    /* Symbol is a unique global symbol.  */
94    unsigned int unique_global : 1;
95 +  /* Symbol should not be versioned.  It is part of the ABI */
96 +  unsigned int no_sym_version : 1;
97  
98    /* String table index in .dynstr if this is a dynamic symbol.  */
99    unsigned long dynstr_index;
100 Index: bfd/elflink.c
101 ===================================================================
102 RCS file: /cvs/src/src/bfd/elflink.c,v
103 retrieving revision 1.430
104 diff -u -p -r1.430 elflink.c
105 --- bfd/elflink.c       15 Nov 2011 11:33:57 -0000      1.430
106 +++ bfd/elflink.c       5 Dec 2011 20:15:50 -0000
107 @@ -1946,6 +1946,9 @@ _bfd_elf_link_assign_sym_version (struct
108    if (!h->def_regular)
109      return TRUE;
110  
111 +  if (h->no_sym_version)
112 +    return TRUE;
113 +
114    bed = get_elf_backend_data (info->output_bfd);
115    p = strchr (h->root.root.string, ELF_VER_CHR);
116    if (p != NULL && h->verinfo.vertree == NULL)
117 Index: bfd/elfxx-mips.c
118 ===================================================================
119 RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
120 retrieving revision 1.296
121 diff -u -p -r1.296 elfxx-mips.c
122 --- bfd/elfxx-mips.c    29 Nov 2011 20:28:54 -0000      1.296
123 +++ bfd/elfxx-mips.c    5 Dec 2011 20:15:50 -0000
124 @@ -7260,6 +7260,7 @@ _bfd_mips_elf_create_dynamic_sections (b
125           h = (struct elf_link_hash_entry *) bh;
126           h->non_elf = 0;
127           h->def_regular = 1;
128 +         h->no_sym_version = 1;
129           h->type = STT_OBJECT;
130  
131           if (! bfd_elf_link_record_dynamic_symbol (info, h))
132
133 --------------080709040708040308010506--
134