From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40137 invoked by alias); 6 Jan 2016 02:34:30 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 40062 invoked by uid 89); 6 Jan 2016 02:34:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*cc, bloom, Tag, Part X-HELO: loongson.cn Received: from Unknown (HELO loongson.cn) (114.242.206.163) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Jan 2016 02:34:21 +0000 Received: from [192.168.1.117] (unknown [110.184.151.95]) by mail.loongson.cn (Coremail) with SMTP id AQAAf_DxX3LNfYxWrj8AAA--.44S2; Wed, 06 Jan 2016 10:37:02 +0800 (CST) To: binutils@sourceware.org, "ma.jiang" , r@hev.cc From: Huang Pei Subject: Re: [PATCH] MIPS support for --hash-style=gnu Message-ID: <568C7D03.301@loongson.cn> Date: Wed, 06 Jan 2016 02:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:AQAAf_DxX3LNfYxWrj8AAA--.44S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KF1DZFyrWr1xCr1ftFWUurg_yoW8Kr4xpr 48Kr1ftrs5ZF1kWF1kKw48Was8Aw4kCa12qFy5Kw109FnIgr1vqryI9ry2qa4DJF4kJFs8 ZFZru34ku3yDZF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUgIb7Iv0xC_KF4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr 0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwC2 0s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI 0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv2 0xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4 A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU 0xZFpf9x0zRUUUUUUUUU= X-CM-SenderInfo: xkxd0whshlqz5rrqw2lrqou0/ X-SW-Source: 2016-01/txt/msg00016.txt.bz2 Hi, everybody, On N64, the layout of .gnu.xhash cause unaligned access at bitmask field, so I suggest we remove ngnusyms at the header of the .gnu.xhash to avoid the unaligned access. Since MIPS ELF requires DT_MIPS_SYMTABNO Tag is present with dynsymcount, so I think ngnusyms can be taken by dynsymcount - symndx // Part 0: .gnu.hash header Elf32_Word nbuckets; // number of hash table buckets Elf32_Word symndx; // number of initial .dynsym entires skipped in chains[] (and xlat[]) Elf32_Word maskwords; // number of ElfW(Addr) words in bitmask Elf32_Word shift2; // bit shift of hashval for second Bloom filter bit // Part 1: .gnu.hash Bloom filter ElfW(Addr) bitmask[maskwords]; // 2 bit Bloom filter on hashval // Part 2: .gnu.hash buckets Elf32_Word buckets[nbuckets]; // indices into chains[] // Part 3: .gnu.hash chains Elf32_Word chains[ngnusyms]; // consecutive hashvals in a given bucket; last entry in chain has LSB set // Part 4: .gnu.xhash translation table Elf32_Word xlat[ngnusyms]; // parallel to chains[]; index into .dynsym below is the patch removing ngnusyms https://github.com/heiher/binutils-mips/commit/ceefe8ac5f52285d2c98a43a66c2d7d31574b3f4 https://github.com/heiher/glibc-mips/commit/db33de9af675f9851c0941ca186baf87c79d8ab9 any suggestion? ........ In practice, though, the .gnu.xhash section is virtually identical to .gnu.hash. [9] // Part 0: .gnu.xhash header Elf32_Word ngnusyms; // number of entries in chains (and xlat); dynsymcount=symndx+ngnusyms // Part 1: .gnu.hash header Elf32_Word nbuckets; // number of hash table buckets Elf32_Word symndx; // number of initial .dynsym entires skipped in chains[] (and xlat[]) Elf32_Word maskwords; // number of ElfW(Addr) words in bitmask Elf32_Word shift2; // bit shift of hashval for second Bloom filter bit // Part 2: .gnu.hash Bloom filter ElfW(Addr) bitmask[maskwords]; // 2 bit Bloom filter on hashval // Part 3: .gnu.hash buckets Elf32_Word buckets[nbuckets]; // indices into chains[] // Part 4: .gnu.hash chains Elf32_Word chains[ngnusyms]; // consecutive hashvals in a given bucket; last entry in chain has LSB set // Part 5: .gnu.xhash translation table Elf32_Word xlat[ngnusyms]; // parallel to chains[]; index into .dynsym ..........