From: Alan Modra Date: Wed, 22 Sep 2004 07:24:14 +0000 (+0000) Subject: binutils/ X-Git-Tag: csl-arm-2004-q3~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbaa0dc5745c8a049fb240105a7f3d5cc79fc78a;p=platform%2Fupstream%2Fbinutils.git binutils/ * readelf.c (process_program_headers): Don't include .tbss in non-TLS segments. ld/testsuite/ * ld-i386/tlsbin.rd: Update for changed segment map. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sh/tlsbin-2.d: Likewise. * ld-sh/tlspic-2.d: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 71708aa..4b07924 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2004-09-22 Alan Modra + + * readelf.c (process_program_headers): Don't include .tbss in non-TLS + segments. + 2004-09-17 Alan Modra * Makefile.am: Run "make dep-am". diff --git a/binutils/readelf.c b/binutils/readelf.c index 6b03b23..d0569c4 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -3302,7 +3302,12 @@ process_program_headers (FILE *file) <= segment->p_vaddr + segment->p_memsz) : ((bfd_vma) section->sh_offset >= segment->p_offset && (section->sh_offset + section->sh_size - <= segment->p_offset + segment->p_filesz)))) + <= segment->p_offset + segment->p_filesz))) + /* .tbss is special. It doesn't contribute memory space + to normal segments. */ + && (!((section->sh_flags & SHF_TLS) != 0 + && section->sh_type == SHT_NOBITS) + || segment->p_type == PT_TLS)) printf ("%s ", SECTION_NAME (section)); } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 428bc22..83e2548 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,25 @@ 2004-09-22 Alan Modra + * ld-i386/tlsbin.rd: Update for changed segment map. + * ld-i386/tlsnopic.rd: Likewise. + * ld-i386/tlspic.rd: Likewise. + * ld-powerpc/tlsexe.r: Likewise. + * ld-powerpc/tlsexe32.r: Likewise. + * ld-powerpc/tlsexetoc.r: Likewise. + * ld-powerpc/tlsso.r: Likewise. + * ld-powerpc/tlsso32.r: Likewise. + * ld-powerpc/tlstocso.r: Likewise. + * ld-s390/tlsbin.rd: Likewise. + * ld-s390/tlsbin_64.rd: Likewise. + * ld-s390/tlspic.rd: Likewise. + * ld-s390/tlspic_64.rd: Likewise. + * ld-sh/tlsbin-2.d: Likewise. + * ld-sh/tlspic-2.d: Likewise. + * ld-x86-64/tlsbin.rd: Likewise. + * ld-x86-64/tlspic.rd: Likewise. + +2004-09-22 Alan Modra + * ld-scripts/overlay-size.d: Don't check .mbss lma. * ld-sh/sh64/mix1.xd: Update for changed .bss file offset. * ld-sh/sh64/shdl32.xd: Likewise. diff --git a/ld/testsuite/ld-i386/tlsbin.rd b/ld/testsuite/ld-i386/tlsbin.rd index d04b1d2..514d652 100644 --- a/ld/testsuite/ld-i386/tlsbin.rd +++ b/ld/testsuite/ld-i386/tlsbin.rd @@ -52,8 +52,8 @@ Program Headers: 00 + 01 +.interp * 02 +.interp .hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text * - 03 +.tdata .tbss .dynamic .got .got.plt * - 04 +.tbss .dynamic * + 03 +.tdata .dynamic .got .got.plt * + 04 +.dynamic * 05 +.tdata .tbss * Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries: diff --git a/ld/testsuite/ld-i386/tlsnopic.rd b/ld/testsuite/ld-i386/tlsnopic.rd index 9bc42b9..d84f616 100644 --- a/ld/testsuite/ld-i386/tlsnopic.rd +++ b/ld/testsuite/ld-i386/tlsnopic.rd @@ -44,8 +44,8 @@ Program Headers: Section to Segment mapping: Segment Sections... 00 +.hash .dynsym .dynstr .rel.dyn .text * - 01 +.tbss .dynamic .got .got.plt * - 02 +.tbss .dynamic * + 01 +.dynamic .got .got.plt * + 02 +.dynamic * 03 +.tbss * Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries: diff --git a/ld/testsuite/ld-i386/tlspic.rd b/ld/testsuite/ld-i386/tlspic.rd index 5b217e6..4b380bc 100644 --- a/ld/testsuite/ld-i386/tlspic.rd +++ b/ld/testsuite/ld-i386/tlspic.rd @@ -46,8 +46,8 @@ Program Headers: Section to Segment mapping: Segment Sections... 00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text * - 01 +.tdata .tbss .dynamic .got .got.plt * - 02 +.tbss .dynamic * + 01 +.tdata .dynamic .got .got.plt * + 02 +.dynamic * 03 +.tdata .tbss * Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 26 entries: diff --git a/ld/testsuite/ld-powerpc/tlsexe.r b/ld/testsuite/ld-powerpc/tlsexe.r index 801312c..42cc2ef 100644 --- a/ld/testsuite/ld-powerpc/tlsexe.r +++ b/ld/testsuite/ld-powerpc/tlsexe.r @@ -50,8 +50,8 @@ Program Headers: +0+ + +01 +\.interp +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +03 +\.tdata \.tbss \.dynamic \.got \.plt - +04 +\.tbss \.dynamic + +03 +\.tdata \.dynamic \.got \.plt + +04 +\.dynamic +05 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset .* contains 3 entries: diff --git a/ld/testsuite/ld-powerpc/tlsexe32.r b/ld/testsuite/ld-powerpc/tlsexe32.r index 217473c..7a9da4d 100644 --- a/ld/testsuite/ld-powerpc/tlsexe32.r +++ b/ld/testsuite/ld-powerpc/tlsexe32.r @@ -51,8 +51,8 @@ Program Headers: +00 + +01 +\.interp +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +03 +\.tdata \.tbss \.dynamic \.got \.plt - +04 +\.tbss \.dynamic + +03 +\.tdata \.dynamic \.got \.plt + +04 +\.dynamic +05 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset 0x268 contains 2 entries: diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.r b/ld/testsuite/ld-powerpc/tlsexetoc.r index 2cf4043..5406136 100644 --- a/ld/testsuite/ld-powerpc/tlsexetoc.r +++ b/ld/testsuite/ld-powerpc/tlsexetoc.r @@ -50,8 +50,8 @@ Program Headers: +0+ + +01 +\.interp +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +03 +\.tdata \.tbss \.dynamic \.got \.plt - +04 +\.tbss \.dynamic + +03 +\.tdata \.dynamic \.got \.plt + +04 +\.dynamic +05 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset .* contains 2 entries: diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r index 2f3793e..487d4a8 100644 --- a/ld/testsuite/ld-powerpc/tlsso.r +++ b/ld/testsuite/ld-powerpc/tlsso.r @@ -43,8 +43,8 @@ Program Headers: Section to Segment mapping: +Segment Sections\.\.\. +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +01 +\.tdata \.tbss \.dynamic \.got \.plt - +02 +\.tbss \.dynamic + +01 +\.tdata \.dynamic \.got \.plt + +02 +\.dynamic +03 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset .* contains 16 entries: diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r index 8781ab3..d2dbe27 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.r +++ b/ld/testsuite/ld-powerpc/tlsso32.r @@ -44,8 +44,8 @@ Program Headers: Section to Segment mapping: +Segment Sections\.\.\. +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +01 +\.tdata \.tbss \.dynamic \.got \.plt - +02 +\.tbss \.dynamic + +01 +\.tdata \.dynamic \.got \.plt + +02 +\.dynamic +03 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries: diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r index f842320..cece257 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.r +++ b/ld/testsuite/ld-powerpc/tlstocso.r @@ -43,8 +43,8 @@ Program Headers: Section to Segment mapping: +Segment Sections\.\.\. +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text - +01 +\.tdata \.tbss \.dynamic \.got \.plt - +02 +\.tbss \.dynamic + +01 +\.tdata \.dynamic \.got \.plt + +02 +\.dynamic +03 +\.tdata \.tbss Relocation section '\.rela\.dyn' at offset .* contains 11 entries: diff --git a/ld/testsuite/ld-s390/tlsbin.rd b/ld/testsuite/ld-s390/tlsbin.rd index f711f11..562cdc1 100644 --- a/ld/testsuite/ld-s390/tlsbin.rd +++ b/ld/testsuite/ld-s390/tlsbin.rd @@ -51,8 +51,8 @@ Program Headers: 00 * 01 +.interp * 02 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * - 03 +.tdata .tbss .dynamic .got * - 04 +.tbss .dynamic * + 03 +.tdata .dynamic .got * + 04 +.dynamic * 05 +.tdata .tbss * Relocation section '.rela.dyn' at offset 0x268 contains 4 entries: diff --git a/ld/testsuite/ld-s390/tlsbin_64.rd b/ld/testsuite/ld-s390/tlsbin_64.rd index 42515f0..5ce09fd 100644 --- a/ld/testsuite/ld-s390/tlsbin_64.rd +++ b/ld/testsuite/ld-s390/tlsbin_64.rd @@ -51,8 +51,8 @@ Program Headers: 00 * 01 +.interp * 02 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * - 03 +.tdata .tbss .dynamic .got * - 04 +.tbss .dynamic * + 03 +.tdata .dynamic .got * + 04 +.dynamic * 05 +.tdata .tbss * Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries: diff --git a/ld/testsuite/ld-s390/tlspic.rd b/ld/testsuite/ld-s390/tlspic.rd index 4764023..2a7640f 100644 --- a/ld/testsuite/ld-s390/tlspic.rd +++ b/ld/testsuite/ld-s390/tlspic.rd @@ -45,8 +45,8 @@ Program Headers: Section to Segment mapping: Segment Sections... +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text - +01 +.tdata .tbss .dynamic .got - +02 +.tbss .dynamic + +01 +.tdata .dynamic .got + +02 +.dynamic +03 +.tdata .tbss Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries: diff --git a/ld/testsuite/ld-s390/tlspic_64.rd b/ld/testsuite/ld-s390/tlspic_64.rd index 144903d..ac8b87a 100644 --- a/ld/testsuite/ld-s390/tlspic_64.rd +++ b/ld/testsuite/ld-s390/tlspic_64.rd @@ -45,8 +45,8 @@ Program Headers: Section to Segment mapping: Segment Sections... 00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * - 01 +.tdata .tbss .dynamic .got * - 02 +.tbss .dynamic * + 01 +.tdata .dynamic .got * + 02 +.dynamic * 03 +.tdata .tbss * Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries: diff --git a/ld/testsuite/ld-sh/tlsbin-2.d b/ld/testsuite/ld-sh/tlsbin-2.d index a2e8ff6..3cb56f9 100644 --- a/ld/testsuite/ld-sh/tlsbin-2.d +++ b/ld/testsuite/ld-sh/tlsbin-2.d @@ -52,8 +52,8 @@ Program Headers: 00 + 01 +\.interp * 02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.plt \.text * - 03 +\.tdata \.tbss \.dynamic \.got * - 04 +\.tbss \.dynamic * + 03 +\.tdata \.dynamic \.got * + 04 +\.dynamic * 05 +\.tdata \.tbss * Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 4 entries: diff --git a/ld/testsuite/ld-sh/tlspic-2.d b/ld/testsuite/ld-sh/tlspic-2.d index 40ece5a..bbdbc4e 100644 --- a/ld/testsuite/ld-sh/tlspic-2.d +++ b/ld/testsuite/ld-sh/tlspic-2.d @@ -46,8 +46,8 @@ Program Headers: Section to Segment mapping: Segment Sections\.\.\. 00 +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.plt \.text * - 01 +\.tdata \.tbss \.dynamic \.got * - 02 +\.tbss \.dynamic * + 01 +\.tdata \.dynamic \.got * + 02 +\.dynamic * 03 +\.tdata \.tbss * Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 10 entries: diff --git a/ld/testsuite/ld-x86-64/tlsbin.rd b/ld/testsuite/ld-x86-64/tlsbin.rd index 490010f..f86422b 100644 --- a/ld/testsuite/ld-x86-64/tlsbin.rd +++ b/ld/testsuite/ld-x86-64/tlsbin.rd @@ -52,7 +52,7 @@ Program Headers: 00 * 01 +.interp * 02 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * - 03 +.tdata .tbss .dynamic .got .got.plt * + 03 +.tdata .dynamic .got .got.plt * 04 +.dynamic * 05 +.tdata .tbss * diff --git a/ld/testsuite/ld-x86-64/tlspic.rd b/ld/testsuite/ld-x86-64/tlspic.rd index 029fa68..fff48cd 100644 --- a/ld/testsuite/ld-x86-64/tlspic.rd +++ b/ld/testsuite/ld-x86-64/tlspic.rd @@ -46,7 +46,7 @@ Program Headers: Section to Segment mapping: Segment Sections... 00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * - 01 +.tdata .tbss .dynamic .got .got.plt * + 01 +.tdata .dynamic .got .got.plt * 02 +.dynamic * 03 +.tdata .tbss *