This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Don't align text/data/bss sections in x86 assembler


On Mon, Jun 3, 2013 at 5:01 PM, Roland McGrath <mcgrathr@google.com> wrote:
> On Fri, May 31, 2013 at 10:32 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> Roland, there are some x86 NACL test failures prior to my change.  I
>> don't know if they are real problems or not.
>
> The ld-size tests all fail in a NaCl configuration for two reasons.  (This
> is not new.  It has been this way since you added those tests and I'm not
> regularly checking the x86 results because only the arm-nacl target is
> currently in production use.)
>
> First, they use -melf_i386 et al.  In a --target=i686-nacl configuration,
> elf_i386 is not supported, only elf_i386_nacl (and likewise for x86-64 and
> x32 variants).  So "#target: i?86-*-*" does not go with "#ld: -melf_i386"
> unless you do the option_regsub hack.  My preference is to do that hack
> rather than disable these tests for i?86-*-nacl*.  Then we get to...
>
> Second, their regexps require certain specific addresses that presume the
> exact layout details of the common layout, which are different for NaCl
> targets.  Is it really necessary for these tests to match the particular
> addresses?  It looks to me like they'd still be testing everything they
> actually want to test if they ignored the specific addresses in the objdump
> output (the contents and order will still match for NaCl targets).  If you
> think that's OK, I can send a change.

I prefer to disable them for NACL and add new tests for
NACL.

>
> The other two failures I see now (in i386.exp) look like they are in fact
> related to your change.  e.g. you updates tlsbindesc.rd but not
> tlsbindesc-nacl.rd.  Please use a --target=x86_64-nacl build to run the
> test suite and fix those up so that i386.exp has no failures.
>
>

Before my changes, I see

FAIL: TLS -fno-pic -shared
FAIL: ld-size/size32-1-i386
FAIL: ld-size/size32-1-x32
FAIL: ld-size/size32-1-x86-64
FAIL: ld-size/size32-2-i386
FAIL: ld-size/size32-2-x32
FAIL: ld-size/size32-2-x86-64
FAIL: ld-size/size32-3-x32
FAIL: ld-size/size32-3-x86-64
FAIL: ld-size/size64-1-x32
FAIL: ld-size/size64-1-x86-64
FAIL: ld-size/size64-2-x32
FAIL: ld-size/size64-2-x86-64
FAIL: TLS -fpic -shared transitions
FAIL: TLS descriptor -fpic -shared transitions
FAIL: TLS -fpic and -fno-pic exec transitions
FAIL: TLS descriptor -fpic and -fno-pic exec transitions
FAIL: ld-x86-64/ilp32-4-nacl

I checked in this patch to fix 2 extra failures
caused by my alignment change.

--
H.J.
---
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 8c4a5f0..3bfea87 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+    * ld-i386/tlsbindesc-nacl.rd: Updated for text/data/bss section
+    alignment change.
+    * ld-x86-64/split-by-file-nacl.rd: Likewise.
+
 2013-05-31  H.J. Lu  <hongjiu.lu@intel.com>

     * ld-i386/pr12718.d: Updated for text/data/bss section alignment
diff --git a/ld/testsuite/ld-i386/tlsbindesc-nacl.rd
b/ld/testsuite/ld-i386/tlsbindesc-nacl.rd
index e3b4340..7399309 100644
--- a/ld/testsuite/ld-i386/tlsbindesc-nacl.rd
+++ b/ld/testsuite/ld-i386/tlsbindesc-nacl.rd
@@ -30,7 +30,7 @@ Key to Flags:
 .*

 Elf file type is EXEC \(Executable file\)
-Entry point 0x0*20158
+Entry point 0x0*20156
 There are [0-9]+ program headers, starting at offset [0-9]+

 Program Headers:
@@ -134,7 +134,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
  +[0-9]+: 00000058 +0 +TLS +GLOBAL +HIDDEN +7 sh7
  +[0-9]+: 0000005c +0 +TLS +GLOBAL +HIDDEN +7 sh8
  +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1
- +[0-9]+: 0+20158 +0 +FUNC +GLOBAL +DEFAULT +1 _start
+ +[0-9]+: 0+20156 +0 +FUNC +GLOBAL +DEFAULT +1 _start
  +[0-9]+: 0000004c +0 +TLS +GLOBAL +HIDDEN +7 sh4
  +[0-9]+: 00000078 +0 +TLS +GLOBAL +DEFAULT +8 bg7
  +[0-9]+: 00000050 +0 +TLS +GLOBAL +HIDDEN +7 sh5
diff --git a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
index 897ab0f..6cc8101 100644
--- a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
+++ b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
@@ -3,12 +3,12 @@ There are 9 section headers, starting at offset 0x80:
 Section Headers:
   \[Nr\] Name              Type            Address          Off
Size   ES Flg Lk Inf Al
   \[ 0\]                   NULL            0000000000000000 000000
000000 00      0   0  0
-  \[ 1\] .text             PROGBITS        0000000000000000 000040
000000 00  AX  0   0  4
+  \[ 1\] .text             PROGBITS        0000000000000000 000040
000000 00  AX  0   0  1
   \[ 2\] .foo              PROGBITS        0000000000000000 000040
000003 00 AXl  0   0  1
-  \[ 3\] .data             PROGBITS        0000000000000000 000044
000000 00  WA  0   0  4
-  \[ 4\] .bss              NOBITS          0000000000000000 000044
000000 00  WA  0   0  4
-  \[ 5\] .foo.0            PROGBITS        0000000000000003 000044
000003 00 AXl  0   0  1
-  \[ 6\] .shstrtab         STRTAB          0000000000000000 000047
000038 00      0   0  1
+  \[ 3\] .data             PROGBITS        0000000000000000 000043
000000 00  WA  0   0  1
+  \[ 4\] .bss              NOBITS          0000000000000000 000043
000000 00  WA  0   0  1
+  \[ 5\] .foo.0            PROGBITS        0000000000000003 000043
000003 00 AXl  0   0  1
+  \[ 6\] .shstrtab         STRTAB          0000000000000000 000046
000038 00      0   0  1
   \[ 7\] .symtab           SYMTAB          0000000000000000 [0-9a-f]+
[0-9a-f]+ 18      8   [0-9]  8
   \[ 8\] .strtab           STRTAB          0000000000000000 [0-9a-f]+
[0-9a-f]+ 00      0   0  1
 Key to Flags:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]