From: Alan Modra Date: Wed, 22 Sep 2004 07:24:14 +0000 (+0000) Subject: binutils/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbaa0dc5745c8a049fb240105a7f3d5cc79fc78a;p=binutils-gdb.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 71708aac7aa..4b07924f184 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 6b03b23d6ce..d0569c4fb90 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 428bc228c02..83e25486cc5 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,23 @@ +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. diff --git a/ld/testsuite/ld-i386/tlsbin.rd b/ld/testsuite/ld-i386/tlsbin.rd index d04b1d29e9d..514d6521461 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 9bc42b9ed37..d84f61658a8 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 5b217e60605..4b380bcafd3 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 801312ccf52..42cc2ef30cc 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 217473cb3fb..7a9da4d41c0 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 2cf4043143e..540613610e9 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 2f3793e99f4..487d4a8fdc3 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 8781ab354ca..d2dbe27f700 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 f842320c3df..cece2574a7c 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 f711f118570..562cdc12895 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 42515f06c54..5ce09fdfac3 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 4764023f496..2a7640f8d6e 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 144903d6b97..ac8b87ab662 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 a2e8ff63052..3cb56f9a111 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 40ece5a6fb3..bbdbc4e1720 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 490010f8541..f86422b400e 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 029fa682f45..fff48cd37b0 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 *