From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32031 invoked by alias); 29 Oct 2004 04:37:17 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 31987 invoked from network); 29 Oct 2004 04:37:14 -0000 Received: from unknown (HELO krynn.se.axis.com) (193.13.178.10) by sourceware.org with SMTP; 29 Oct 2004 04:37:14 -0000 Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.83.5.18]) by krynn.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id i9T4bC5w003954; Fri, 29 Oct 2004 06:37:12 +0200 Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id i9T4bCdD014972; Fri, 29 Oct 2004 06:37:12 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id i9T4bCCt014968; Fri, 29 Oct 2004 06:37:12 +0200 Date: Fri, 29 Oct 2004 04:37:00 -0000 Message-Id: <200410290437.i9T4bCCt014968@ignucius.se.axis.com> From: Hans-Peter Nilsson To: binutils@sources.redhat.com Subject: [RFA:] elflink.c: Hide _GLOBAL_OFFSET_TABLE_ X-SW-Source: 2004-10/txt/msg00457.txt.bz2 A long time ago, in , I suggested a patch to make the visibility of _GLOBAL_OFFSET_TABLE_ target-selectable through a bfd hook, with the intent on making it hidden, but keeping it visible to avoid breaking something obscure somewhere. Alan Modra thought it'd be just as good to make it *always* hidden. Here's the patch for that and the testsuite adjustments for i686-pc-linux-gnu (built and tested there). If that's still ok, I'll adjust the rest of the testsuite. Ok to commit? bfd: * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_SYMBOL. ld/testsuite: * ld-i386/tlsbin.rd: Adjust for hidden _GLOBAL_OFFSET_TABLE_. * ld-i386/tlsnopic.rd, ld-i386/tlspic.rd: Ditto. Index: elflink.c =================================================================== RCS file: /cvs/src/src/bfd/elflink.c,v retrieving revision 1.115 diff -u -p -r1.115 elflink.c --- elflink.c 26 Oct 2004 13:46:00 -0000 1.115 +++ elflink.c 29 Oct 2004 04:11:33 -0000 @@ -88,6 +88,7 @@ _bfd_elf_create_got_section (bfd *abfd, h = (struct elf_link_hash_entry *) bh; h->def_regular = 1; h->type = STT_OBJECT; + h->other = STV_HIDDEN; if (! info->executable && ! bfd_elf_link_record_dynamic_symbol (info, h)) cvs diff: Diffing . Index: tlsbin.rd =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-i386/tlsbin.rd,v retrieving revision 1.3 diff -u -p -r1.3 tlsbin.rd --- tlsbin.rd 22 Sep 2004 07:24:13 -0000 1.3 +++ tlsbin.rd 29 Oct 2004 04:07:51 -0000 @@ -66,13 +66,13 @@ Relocation section '.rel.dyn' at offset 0+804a114 0000060e R_386_TLS_TPOFF +0+ +sG4 0+804a118 00000825 R_386_TLS_TPOFF32 0+ +sG6 0+804a11c 00000925 R_386_TLS_TPOFF32 0+ +sG1 -0+804a120 00000d0e R_386_TLS_TPOFF +0+ +sG8 +0+804a120 00000c0e R_386_TLS_TPOFF +0+ +sG8 -Relocation section '.rel.plt' at offset 0x30c contains 1 entries: +Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entries: Offset +Info +Type +Sym.Value Sym. Name -0+804a130 00000e07 R_386_JUMP_SLOT +[0-9a-f]+ +___tls_get_addr +0+804a130 00000d07 R_386_JUMP_SLOT +[0-9a-f]+ +___tls_get_addr -Symbol table '.dynsym' contains 15 entries: +Symbol table '.dynsym' contains 14 entries: +Num: +Value Size Type +Bind +Vis +Ndx Name +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND * +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG3 @@ -85,7 +85,6 @@ Symbol table '.dynsym' contains 15 entri +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG6 +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG1 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG8 +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT UND ___tls_get_addr @@ -158,7 +157,7 @@ Symbol table '.symtab' contains 75 entri +[0-9]+: 00000014 +0 TLS +GLOBAL DEFAULT +9 sg6 +[0-9]+: 00000018 +0 TLS +GLOBAL DEFAULT +9 sg7 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ + +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL HIDDEN 13 _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end +[0-9]+: 00000044 +0 TLS +GLOBAL HIDDEN +9 sh2 +[0-9]+: 00000054 +0 TLS +GLOBAL HIDDEN +9 sh6 Index: tlsnopic.rd =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-i386/tlsnopic.rd,v retrieving revision 1.4 diff -u -p -r1.4 tlsnopic.rd --- tlsnopic.rd 22 Sep 2004 07:24:13 -0000 1.4 +++ tlsnopic.rd 29 Oct 2004 04:07:52 -0000 @@ -72,7 +72,7 @@ Relocation section '.rel.dyn' at offset 0+208c 0+d0e R_386_TLS_TPOFF 0+ sg2 -Symbol table '.dynsym' contains 17 entries: +Symbol table '.dynsym' contains 16 entries: +Num: +Value Size Type +Bind +Vis +Ndx Name +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND * +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +5 * @@ -89,7 +89,6 @@ Symbol table '.dynsym' contains 17 entri +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sg2 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: 0+2098 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end Symbol table '.symtab' contains 36 entries: @@ -118,6 +117,7 @@ Symbol table '.symtab' contains 36 entri +[0-9]+: 0+1c +0 TLS +LOCAL HIDDEN +6 sh3 +[0-9]+: 0+20 +0 TLS +LOCAL HIDDEN +6 sh4 +[0-9]+: 0+14 +0 TLS +LOCAL HIDDEN +6 sh1 + +[0-9]+: 0+2098 +0 OBJECT LOCAL HIDDEN ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: 0+18 +0 TLS +LOCAL HIDDEN +6 sh2 +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _DYNAMIC +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sg3 @@ -128,5 +128,4 @@ Symbol table '.symtab' contains 36 entri +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sg2 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: 0+2098 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end Index: tlspic.rd =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-i386/tlspic.rd,v retrieving revision 1.3 diff -u -p -r1.3 tlspic.rd --- tlspic.rd 22 Sep 2004 07:24:13 -0000 1.3 +++ tlspic.rd 29 Oct 2004 04:07:52 -0000 @@ -81,9 +81,9 @@ Relocation section '.rel.dyn' at offset Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entries: Offset Info Type Sym.Value Sym. Name -[0-9a-f]+ 0+1407 R_386_JUMP_SLOT 0+ ___tls_get_addr +[0-9a-f]+ 0+1307 R_386_JUMP_SLOT 0+ ___tls_get_addr -Symbol table '.dynsym' contains 21 entries: +Symbol table '.dynsym' contains 20 entries: +Num: + Value Size Type + Bind +Vis +Ndx Name +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND * +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +7 * @@ -103,7 +103,6 @@ Symbol table '.dynsym' contains 21 entri +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6 +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end +[0-9]+: 0+ +0 NOTYPE GLOBAL DEFAULT UND ___tls_get_addr @@ -149,6 +148,7 @@ Symbol table '.symtab' contains 57 entri +[0-9]+: 0+74 +0 TLS +LOCAL HIDDEN +9 sH6 +[0-9]+: 0+7c +0 TLS +LOCAL HIDDEN +9 sH8 +[0-9]+: 0+40 +0 TLS +LOCAL HIDDEN +8 sh1 + +[0-9]+: [0-9a-f]+ +0 OBJECT LOCAL HIDDEN ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: 0+44 +0 TLS +LOCAL HIDDEN +8 sh2 +[0-9]+: 0+54 +0 TLS +LOCAL HIDDEN +8 sh6 +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8 @@ -163,6 +163,5 @@ Symbol table '.symtab' contains 57 entri +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6 +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7 +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata - +[0-9]+: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end +[0-9]+: 0+ +0 NOTYPE GLOBAL DEFAULT UND ___tls_get_addr brgds, H-P