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]

RFC: PR ld/18277: --compress-debug-sections=zlib may generate larger debug sections


Section name is added to section name section to early for
_bfd_elf_assign_file_positions_for_non_load to change section name
if compressed section size is bigger than uncompressed section.

This patch delays adding setion name to section name section after the
section is compressed in bfd_elf_assign_file_positions_for_non_load and
we only change setion name if compressed section size is smaller.  It
means that section name section is placed after debug sections.  Some
testcases have to be adjusted.

Any comments, feedbacks, objections?

Thanks.

H.J.
---
diff --git a/bfd/compress.c b/bfd/compress.c
index dfde50e..d0f745f 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -72,8 +72,7 @@ decompress_contents (bfd_byte *compressed_buffer,
 static bfd_size_type
 bfd_compress_section_contents (bfd *abfd, sec_ptr sec,
 			       bfd_byte *uncompressed_buffer,
-			       bfd_size_type uncompressed_size,
-			       bfd_boolean write_compress)
+			       bfd_size_type uncompressed_size)
 {
   uLong compressed_size;
   bfd_byte *buffer;
@@ -177,11 +176,8 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec,
 
       compressed_size += header_size;
       /* PR binutils/18087: If compression didn't make the section smaller,
-	 just keep it uncompressed.  We always generate .zdebug_* section
-	 when linking since section names have been finalized and they
-	 can't be changed easily.  */
-      if ((write_compress && compression_header_size == 0)
-	   || compressed_size < uncompressed_size)
+	 just keep it uncompressed.  */
+      if (compressed_size < uncompressed_size)
 	{
 	  bfd_update_compression_header (abfd, buffer, sec);
 
@@ -547,8 +543,7 @@ bfd_init_section_compress_status (bfd *abfd, sec_ptr sec)
     {
       uncompressed_size = bfd_compress_section_contents (abfd, sec,
 							 uncompressed_buffer,
-							 uncompressed_size,
-							 FALSE);
+							 uncompressed_size);
       ret = uncompressed_size != 0;
     }
 
@@ -590,5 +585,5 @@ bfd_compress_section (bfd *abfd, sec_ptr sec, bfd_byte *uncompressed_buffer)
 
   /* Compress it.  */
   return bfd_compress_section_contents (abfd, sec, uncompressed_buffer,
-					uncompressed_size, TRUE) != 0;
+					uncompressed_size) != 0;
 }
diff --git a/bfd/elf.c b/bfd/elf.c
index 85a4b6b..419e413 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2702,16 +2702,24 @@ _bfd_elf_init_reloc_shdr (bfd *abfd,
   rel_hdr = bfd_zalloc (abfd, amt);
   reldata->hdr = rel_hdr;
 
-  amt = sizeof ".rela" + strlen (asect->name);
-  name = (char *) bfd_alloc (abfd, amt);
-  if (name == NULL)
-    return FALSE;
-  sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
-  rel_hdr->sh_name =
-    (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), name,
-					FALSE);
-  if (rel_hdr->sh_name == (unsigned int) -1)
-    return FALSE;
+  if ((asect->flags & SEC_ELF_COMPRESS) != 0)
+    /* If this section will be compressed, delay adding the reloc
+       setion name to section name section after it is compressed
+       in _bfd_elf_assign_file_positions_for_non_load.  */
+    rel_hdr->sh_name = (unsigned int) -1;
+  else
+    {
+      amt = sizeof ".rela" + strlen (asect->name);
+      name = (char *) bfd_alloc (abfd, amt);
+      if (name == NULL)
+	return FALSE;
+      sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
+      rel_hdr->sh_name =
+	(unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), name,
+					    FALSE);
+      if (rel_hdr->sh_name == (unsigned int) -1)
+	return FALSE;
+    }
   rel_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL;
   rel_hdr->sh_entsize = (use_rela_p
 			 ? bed->s->sizeof_rela
@@ -2773,32 +2781,20 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg)
       /* Set SEC_ELF_COMPRESS to indicate this section should be
 	 compressed.  */
       asect->flags |= SEC_ELF_COMPRESS;
-
-      if (arg->link_info->compress_debug != COMPRESS_DEBUG_GABI_ZLIB)
-	{
-	  /* If SHF_COMPRESSED isn't used, rename compressed DWARF
-	     debug section to .zdebug_*.  */
-	  unsigned int len = strlen (name);
-	  char *new_name = bfd_alloc (abfd, len + 2);
-	  if (new_name == NULL)
-	    {
-	      arg->failed = TRUE;
-	      return;
-	    }
-	  new_name[0] = '.';
-	  new_name[1] = 'z';
-	  memcpy (new_name + 2, name + 1, len);
-	  bfd_rename_section (abfd, asect, new_name);
-	  name = asect->name;
-	}
+      /* If this section will be compressed, delay adding setion
+	 name to section name section after it is compressed in
+	 _bfd_elf_assign_file_positions_for_non_load.  */
+      this_hdr->sh_name = (unsigned int) -1;
     }
-
-  this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
-							  name, FALSE);
-  if (this_hdr->sh_name == (unsigned int) -1)
+  else
     {
-      arg->failed = TRUE;
-      return;
+      this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+							      name, FALSE);
+      if (this_hdr->sh_name == (unsigned int) -1)
+	{
+	  arg->failed = TRUE;
+	  return;
+	}
     }
 
   /* Don't clear sh_flags. Assembler may set additional bits.  */
@@ -3210,11 +3206,13 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
 
       if (d->this_hdr.sh_type != SHT_GROUP)
 	d->this_idx = section_number++;
-      _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->this_hdr.sh_name);
+      if (d->this_hdr.sh_name != (unsigned int) -1)
+	_bfd_elf_strtab_addref (elf_shstrtab (abfd), d->this_hdr.sh_name);
       if (d->rel.hdr)
 	{
 	  d->rel.idx = section_number++;
-	  _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rel.hdr->sh_name);
+	  if (d->rel.hdr->sh_name != (unsigned int) -1)
+	    _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rel.hdr->sh_name);
 	}
       else
 	d->rel.idx = 0;
@@ -3222,7 +3220,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
       if (d->rela.hdr)
 	{
 	  d->rela.idx = section_number++;
-	  _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rela.hdr->sh_name);
+	  if (d->rela.hdr->sh_name != (unsigned int) -1)
+	    _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rela.hdr->sh_name);
 	}
       else
 	d->rela.idx = 0;
@@ -3260,9 +3259,6 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
       return FALSE;
     }
 
-  _bfd_elf_strtab_finalize (elf_shstrtab (abfd));
-  t->shstrtab_hdr.sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd));
-
   elf_numsections (abfd) = section_number;
   elf_elfheader (abfd)->e_shnum = section_number;
 
@@ -3481,9 +3477,6 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
   for (secn = 1; secn < section_number; ++secn)
     if (i_shdrp[secn] == NULL)
       i_shdrp[secn] = i_shdrp[0];
-    else
-      i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd),
-						       i_shdrp[secn]->sh_name);
   return TRUE;
 }
 
@@ -3740,7 +3733,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
   shstrtab_hdr->sh_entsize = 0;
   shstrtab_hdr->sh_link = 0;
   shstrtab_hdr->sh_info = 0;
-  /* sh_offset is set in assign_file_positions_except_relocs.  */
+  /* sh_offset is set in _bfd_elf_assign_file_positions_for_non_load.  */
   shstrtab_hdr->sh_addralign = 1;
 
   if (!assign_file_positions_except_relocs (abfd, link_info))
@@ -5152,7 +5145,8 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
 		   /* Compress DWARF debug sections.  */
 	       || hdr == i_shdrpp[elf_onesymtab (abfd)]
 	       || hdr == i_shdrpp[elf_symtab_shndx (abfd)]
-	       || hdr == i_shdrpp[elf_strtab_sec (abfd)])
+	       || hdr == i_shdrpp[elf_strtab_sec (abfd)]
+	       || hdr == i_shdrpp[elf_shstrtab_sec (abfd)])
 	hdr->sh_offset = -1;
       else
 	off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE);
@@ -5404,7 +5398,8 @@ assign_file_positions_except_relocs (bfd *abfd,
 		  /* Compress DWARF debug sections.  */
 	      || i == elf_onesymtab (abfd)
 	      || i == elf_symtab_shndx (abfd)
-	      || i == elf_strtab_sec (abfd))
+	      || i == elf_strtab_sec (abfd)
+	      || i == elf_shstrtab_sec (abfd))
 	    {
 	      hdr->sh_offset = -1;
 	    }
@@ -5560,7 +5555,7 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
 {
   file_ptr off;
   unsigned int i, num_sec;
-  Elf_Internal_Shdr **shdrpp;
+  Elf_Internal_Shdr **shdrpp, *hdr;
   Elf_Internal_Ehdr *i_ehdrp;
   const struct elf_backend_data *bed;
 
@@ -5574,21 +5569,78 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
       shdrp = *shdrpp;
       if (shdrp->sh_offset == -1)
 	{
+	  asection *sec = shdrp->bfd_section;
 	  bfd_boolean is_rel = (shdrp->sh_type == SHT_REL
 				|| shdrp->sh_type == SHT_RELA);
 	  if (is_rel
-	      || (shdrp->bfd_section != NULL
-		  && (shdrp->bfd_section->flags & SEC_ELF_COMPRESS)))
+	      || (sec != NULL && (sec->flags & SEC_ELF_COMPRESS)))
 	    {
 	      if (!is_rel)
 		{
+		  const char *name = sec->name;
+		  char *new_name;
+		  unsigned int len = strlen (name);
+		  struct bfd_elf_section_data *d;
+
 		  /* Compress DWARF debug sections.  */
-		  if (!bfd_compress_section (abfd, shdrp->bfd_section,
+		  if (!bfd_compress_section (abfd, sec,
 					     shdrp->contents))
 		    return FALSE;
+
+		  if (sec->compress_status == COMPRESS_SECTION_DONE
+		      && (abfd->flags & BFD_COMPRESS_GABI) == 0)
+		    {
+		      /* If section is compressed with zlib-gnu, add
+			 .zdebug_* to section name section.  */
+		      new_name = bfd_alloc (abfd, len + 2);
+		      if (new_name == NULL)
+			return FALSE;
+		      new_name[0] = '.';
+		      new_name[1] = 'z';
+		      memcpy (new_name + 2, name + 1, len);
+		      name = new_name;
+		    }
+		  /* Add setion name to section name section.  */
+		  if (shdrp->sh_name != (unsigned int) -1)
+		    abort ();
+		  shdrp->sh_name
+		    = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+							  name, FALSE);
+		  d = elf_section_data (sec);
+
+		  /* Add reloc setion name to section name section.  */
+		  if (d->rel.hdr)
+		    {
+		       if (d->rel.hdr->sh_name != (unsigned int) -1)
+			 abort ();
+		      new_name = bfd_alloc (abfd, sizeof ".rel" + len);
+		      if (name == NULL)
+			return FALSE;
+		      memcpy (new_name, ".rel", sizeof ".rel");
+		      memcpy (new_name + sizeof ".rel" - 1, name, len + 1);
+		      d->rel.hdr->sh_name
+			= (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+							      new_name,
+							      FALSE);
+		    }
+		  if (d->rela.hdr)
+		    {
+		       if (d->rela.hdr->sh_name != (unsigned int) -1)
+			 abort ();
+		      new_name = bfd_alloc (abfd, sizeof ".rela" + len);
+		      if (name == NULL)
+			return FALSE;
+		      memcpy (new_name, ".rela", sizeof ".rela");
+		      memcpy (new_name + sizeof ".rela" - 1, name, len + 1);
+		      d->rela.hdr->sh_name
+			= (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+							      new_name,
+							      FALSE);
+		    }
+
 		  /* Update section size and contents.  */
-		  shdrp->sh_size = shdrp->bfd_section->size;
-		  shdrp->contents = shdrp->bfd_section->contents;
+		  shdrp->sh_size = sec->size;
+		  shdrp->contents = sec->contents;
 		  shdrp->bfd_section->contents = NULL;
 		}
 	      off = _bfd_elf_assign_file_position_for_section (shdrp,
@@ -5598,7 +5650,7 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
 	}
     }
 
-/* Place the section headers.  */
+  /* Place the section headers.  */
   i_ehdrp = elf_elfheader (abfd);
   bed = get_elf_backend_data (abfd);
   off = align_file_position (off, 1 << bed->s->log_file_align);
@@ -5606,6 +5658,14 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
   off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
   elf_next_file_pos (abfd) = off;
 
+  /* Place section name section after DWARF debug sections have been
+     compressed.  */
+  _bfd_elf_strtab_finalize (elf_shstrtab (abfd));
+  hdr = &elf_tdata (abfd)->shstrtab_hdr;
+  hdr->sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd));
+  off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE);
+  elf_next_file_pos (abfd) = off;
+
   return TRUE;
 }
 
@@ -5636,6 +5696,9 @@ _bfd_elf_write_object_contents (bfd *abfd)
   num_sec = elf_numsections (abfd);
   for (count = 1; count < num_sec; count++)
     {
+      i_shdrp[count]->sh_name
+	= _bfd_elf_strtab_offset (elf_shstrtab (abfd),
+				  i_shdrp[count]->sh_name);
       if (bed->elf_backend_section_processing)
 	(*bed->elf_backend_section_processing) (abfd, i_shdrp[count]);
       if (i_shdrp[count]->contents)
diff --git a/binutils/testsuite/binutils-all/i386/compressed-1b.d b/binutils/testsuite/binutils-all/i386/compressed-1b.d
index 8cc9653..220499a 100644
--- a/binutils/testsuite/binutils-all/i386/compressed-1b.d
+++ b/binutils/testsuite/binutils-all/i386/compressed-1b.d
@@ -5,7 +5,7 @@
 #readelf: -S --wide
 #name: strip on uncompressed debug sections
 
-There are 5 section headers, starting at offset 0x78:
+There are 5 section headers, starting at offset 0x5c:
 
 Section Headers:
   \[Nr\] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
@@ -13,6 +13,6 @@ Section Headers:
   \[ 1\] .text             PROGBITS        00000000 000040 00001b 00  AX  0   0 16
   \[ 2\] .data             PROGBITS        00000000 00005b 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          00000000 00005b 000000 00  WA  0   0  1
-  \[ 4\] .shstrtab         STRTAB          00000000 00005b 00001c 00      0   0  1
+  \[ 4\] .shstrtab         STRTAB          00000000 000124 00001c 00      0   0  1
 Key to Flags:
 #...
diff --git a/binutils/testsuite/binutils-all/i386/compressed-1c.d b/binutils/testsuite/binutils-all/i386/compressed-1c.d
index f05380f..a573d27 100644
--- a/binutils/testsuite/binutils-all/i386/compressed-1c.d
+++ b/binutils/testsuite/binutils-all/i386/compressed-1c.d
@@ -5,7 +5,7 @@
 #readelf: -S --wide
 #name: strip on compressed debug sections
 
-There are 5 section headers, starting at offset 0x78:
+There are 5 section headers, starting at offset 0x5c:
 
 Section Headers:
   \[Nr\] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
@@ -13,6 +13,6 @@ Section Headers:
   \[ 1\] .text             PROGBITS        00000000 000040 00001b 00  AX  0   0 16
   \[ 2\] .data             PROGBITS        00000000 00005b 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          00000000 00005b 000000 00  WA  0   0  1
-  \[ 4\] .shstrtab         STRTAB          00000000 00005b 00001c 00      0   0  1
+  \[ 4\] .shstrtab         STRTAB          00000000 000124 00001c 00      0   0  1
 Key to Flags:
 #...
diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64
index acebab9..2557bcc 100644
--- a/binutils/testsuite/binutils-all/readelf.s-64
+++ b/binutils/testsuite/binutils-all/readelf.s-64
@@ -13,7 +13,7 @@ Section Headers:
  +000000000000000[48] +0000000000000000 +WA +0 +0 +.*
  +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58)
  +0000000000000000 +0000000000000000 +WA +0 +0 +.*
- +\[ 5\] .shstrtab +STRTAB +0000000000000000 +000000(4c|50|54|58)
+ +\[ 5\] .shstrtab +STRTAB +0000000000000000 +.*
  +00000000000000.. +0000000000000000 +0 +0 +.*
  +\[ 6\] .symtab +SYMTAB +0000000000000000 +0+.*
 # aarch64-elf targets have one more data symbol.
diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1b.d b/binutils/testsuite/binutils-all/x86-64/compressed-1b.d
index ed5a45e..8e3dbe6 100644
--- a/binutils/testsuite/binutils-all/x86-64/compressed-1b.d
+++ b/binutils/testsuite/binutils-all/x86-64/compressed-1b.d
@@ -5,7 +5,7 @@
 #readelf: -S --wide
 #name: strip on uncompressed debug sections
 
-There are 5 section headers, starting at offset 0x78:
+There are 5 section headers, starting at offset 0x58:
 
 Section Headers:
   \[Nr\] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
@@ -13,6 +13,6 @@ Section Headers:
   \[ 1\] .text             PROGBITS        0000000000000000 000040 000015 00  AX  0   0 16
   \[ 2\] .data             PROGBITS        0000000000000000 000055 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          0000000000000000 000055 000000 00  WA  0   0  1
-  \[ 4\] .shstrtab         STRTAB          0000000000000000 000055 00001c 00      0   0  1
+  \[ 4\] .shstrtab         STRTAB          0000000000000000 000198 00001c 00      0   0  1
 Key to Flags:
 #...
diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1c.d b/binutils/testsuite/binutils-all/x86-64/compressed-1c.d
index a0308c8..b37fd36 100644
--- a/binutils/testsuite/binutils-all/x86-64/compressed-1c.d
+++ b/binutils/testsuite/binutils-all/x86-64/compressed-1c.d
@@ -5,7 +5,7 @@
 #readelf: -S --wide
 #name: strip on compressed debug sections
 
-There are 5 section headers, starting at offset 0x78:
+There are 5 section headers, starting at offset 0x58:
 
 Section Headers:
   \[Nr\] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
@@ -13,6 +13,6 @@ Section Headers:
   \[ 1\] .text             PROGBITS        0000000000000000 000040 000015 00  AX  0   0 16
   \[ 2\] .data             PROGBITS        0000000000000000 000055 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          0000000000000000 000055 000000 00  WA  0   0  1
-  \[ 4\] .shstrtab         STRTAB          0000000000000000 000055 00001c 00      0   0  1
+  \[ 4\] .shstrtab         STRTAB          0000000000000000 000198 00001c 00      0   0  1
 Key to Flags:
 #...
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d b/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d
index f2c045f..b32133e 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d
@@ -2,7 +2,7 @@
 #readelf: -S
 #name: x86-64 (ILP32) unwind
 
-There are 8 section headers, starting at offset 0xc8:
+There are 8 section headers, starting at offset 0x90:
 
 Section Headers:
   \[Nr\] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
@@ -11,9 +11,9 @@ Section Headers:
   \[ 2\] .data             PROGBITS        00000000 000034 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          00000000 000034 000000 00  WA  0   0  1
   \[ 4\] .eh_frame         X86_64_UNWIND   00000000 000034 000008 00   A  0   0  1
-  \[ 5\] .shstrtab         STRTAB          00000000 00003c 000036 00      0   0  1
-  \[ 6\] .symtab           SYMTAB          00000000 000074 000050 10      7   5  4
-  \[ 7\] .strtab           STRTAB          00000000 0000c4 000001 00      0   0  1
+  \[ 5\] .shstrtab         STRTAB          00000000 0001d0 000036 00      0   0  1
+  \[ 6\] .symtab           SYMTAB          00000000 00003c 000050 10      7   5  4
+  \[ 7\] .strtab           STRTAB          00000000 00008c 000001 00      0   0  1
 Key to Flags:
   W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\)
   I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\)
diff --git a/gas/testsuite/gas/i386/x86-64-unwind.d b/gas/testsuite/gas/i386/x86-64-unwind.d
index 7842597..983f4e1 100644
--- a/gas/testsuite/gas/i386/x86-64-unwind.d
+++ b/gas/testsuite/gas/i386/x86-64-unwind.d
@@ -1,7 +1,7 @@
 #readelf: -S
 #name: x86-64 unwind
 
-There are 8 section headers, starting at offset 0x100:
+There are 8 section headers, starting at offset 0xc8:
 
 Section Headers:
   \[Nr\] Name              Type             Address           Offset
@@ -16,11 +16,11 @@ Section Headers:
        0000000000000000  0000000000000000  WA       0     0     1
   \[ 4\] \.eh_frame         X86_64_UNWIND    0000000000000000  00000040
        0000000000000008  0000000000000000   A       0     0     1
-  \[ 5\] \.shstrtab         STRTAB           0000000000000000  00000048
+  \[ 5\] \.shstrtab         STRTAB           0000000000000000  000002c8
        0000000000000036  0000000000000000           0     0     1
-  \[ 6\] \.symtab           SYMTAB           0000000000000000  00000080
+  \[ 6\] \.symtab           SYMTAB           0000000000000000  00000048
        0000000000000078  0000000000000018           7     5     8
-  \[ 7\] \.strtab           STRTAB           0000000000000000  000000f8
+  \[ 7\] \.strtab           STRTAB           0000000000000000  000000c0
        0000000000000001  0000000000000000           0     0     1
 Key to Flags:
 #...
diff --git a/gas/testsuite/gas/ia64/alias-ilp32.d b/gas/testsuite/gas/ia64/alias-ilp32.d
index 8dbb7d8..d882b3c 100644
--- a/gas/testsuite/gas/ia64/alias-ilp32.d
+++ b/gas/testsuite/gas/ia64/alias-ilp32.d
@@ -12,7 +12,7 @@ Section Headers:
  +\[ 2\] .data +PROGBITS +00000000 000040 000000 00 +WA +0 +0 +1
  +\[ 3\] .bss +NOBITS +00000000 000040 000000 00 +WA +0 +0 +1
  +\[ 4\] 1234 +PROGBITS +00000000 000040 000005 00 +WA +0 +0 +1
- +\[ 5\] .shstrtab +STRTAB +00000000 000045 000031 00 +0 +0 +1
+ +\[ 5\] .shstrtab +STRTAB +00000000 [0-9a-f]+ 000031 00 +0 +0 +1
  +\[ 6\] .symtab +SYMTAB +00000000 [0-9a-f]+ 000060 10 +7 +6 +4
  +\[ 7\] .strtab +STRTAB +00000000 [0-9a-f]+ 000006 00 +0 +0 +1
 Key to Flags:
diff --git a/gas/testsuite/gas/ia64/alias.d b/gas/testsuite/gas/ia64/alias.d
index 833e07e..398bff4 100644
--- a/gas/testsuite/gas/ia64/alias.d
+++ b/gas/testsuite/gas/ia64/alias.d
@@ -16,7 +16,7 @@ Section Headers:
  +0000000000000000 +0000000000000000 +WA +0 +0 +1
  +\[ 4\] 1234 +PROGBITS +0000000000000000 +00000040
  +0000000000000005 +0000000000000000 +WA +0 +0 +1
- +\[ 5\] \.shstrtab +STRTAB +0000000000000000 +00000045
+ +\[ 5\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+
  +0000000000000031 +0000000000000000 +0 +0 +1
  +\[ 6\] \.symtab +SYMTAB +0000000000000000 .*
  +0000000000000090 +0000000000000018 +7 +6 +8
diff --git a/gas/testsuite/gas/ia64/group-1.d b/gas/testsuite/gas/ia64/group-1.d
index 3a20e5a..3ae3c80 100644
--- a/gas/testsuite/gas/ia64/group-1.d
+++ b/gas/testsuite/gas/ia64/group-1.d
@@ -18,7 +18,7 @@ Section Headers:
        0000000000000000  0000000000000000  WA       0     0     1
   \[ 5\] \.text             PROGBITS         0000000000000000  00000050
        0000000000000010  0000000000000000 AXG       0     0     16
-  \[ 6\] \.shstrtab         STRTAB           0000000000000000  00000060
+  \[ 6\] \.shstrtab         STRTAB           0000000000000000  [0-9a-f]+
        0000000000000033  0000000000000000           0     0     1
   \[ 7\] \.symtab           SYMTAB           0000000000000000  .*
        00000000000000c0  0000000000000018           8     8     8
diff --git a/gas/testsuite/gas/ia64/group-2.d b/gas/testsuite/gas/ia64/group-2.d
index 205bd6b..7370367 100644
--- a/gas/testsuite/gas/ia64/group-2.d
+++ b/gas/testsuite/gas/ia64/group-2.d
@@ -25,7 +25,7 @@ Section Headers:
        0000000000000018  0000000000000000 ALG       5     5     8
   \[ 8\] \.rela\.gnu\.linkonc RELA             0000000000000000  .*
        0000000000000048  0000000000000018   I      10     7     8
-  \[ 9\] \.shstrtab         STRTAB           0000000000000000  00000078
+  \[ 9\] \.shstrtab         STRTAB           0000000000000000  [0-9a-f]+
        0000000000000081  0000000000000000           0     0     1
   \[10\] \.symtab           SYMTAB           0000000000000000  .*
        00000000000000d8  0000000000000018          11     9     8
diff --git a/gas/testsuite/gas/ia64/secname-ilp32.d b/gas/testsuite/gas/ia64/secname-ilp32.d
index e1cf066..4146307 100644
--- a/gas/testsuite/gas/ia64/secname-ilp32.d
+++ b/gas/testsuite/gas/ia64/secname-ilp32.d
@@ -12,7 +12,7 @@ Section Headers:
   \[ 2\] .data             PROGBITS        00000000 000040 000000 00  WA  0   0  1
   \[ 3\] .bss              NOBITS          00000000 000040 000000 00  WA  0   0  1
   \[ 4\] .foo              PROGBITS        00000000 000040 000008 00  WA  0   0  8
-  \[ 5\] .shstrtab         STRTAB          00000000 000048 000031 00      0   0  1
+  \[ 5\] .shstrtab         STRTAB          00000000 [0-9a-f]+ 000031 00      0   0  1
   \[ 6\] .symtab           SYMTAB          00000000 [0-9a-f]+ 000050 10      7   5  4
   \[ 7\] .strtab           STRTAB          00000000 [0-9a-f]+ 000001 00      0   0  1
 Key to Flags:
diff --git a/gas/testsuite/gas/ia64/secname.d b/gas/testsuite/gas/ia64/secname.d
index d77ac52..79f1e33 100644
--- a/gas/testsuite/gas/ia64/secname.d
+++ b/gas/testsuite/gas/ia64/secname.d
@@ -16,7 +16,7 @@ Section Headers:
        0000000000000000  0000000000000000  WA       0     0     1
   \[ 4\] \.foo              PROGBITS         0000000000000000  00000040
        0000000000000008  0000000000000000  WA       0     0     8
-  \[ 5\] \.shstrtab         STRTAB           0000000000000000  00000048
+  \[ 5\] \.shstrtab         STRTAB           0000000000000000  [0-9a-f]+
        0000000000000031  0000000000000000           0     0     1
   \[ 6\] \.symtab           SYMTAB           0000000000000000  .*
        0000000000000078  0000000000000018           7     5     8
diff --git a/gas/testsuite/gas/ia64/unwind-ilp32.d b/gas/testsuite/gas/ia64/unwind-ilp32.d
index b263756..cd25b0d 100644
--- a/gas/testsuite/gas/ia64/unwind-ilp32.d
+++ b/gas/testsuite/gas/ia64/unwind-ilp32.d
@@ -13,7 +13,7 @@ Section Headers:
   \[ 3\] .bss              NOBITS          00000000 000040 000000 00  WA  0   0  1
   \[ 4\] .IA_64.unwind_inf PROGBITS        00000000 000040 000008 00   A  0   0  8
   \[ 5\] .IA_64.unwind     IA_64_UNWIND    00000000 000048 000008 00  AL  1   1  8
-  \[ 6\] .shstrtab         STRTAB          00000000 000050 00004d 00      0   0  1
+  \[ 6\] .shstrtab         STRTAB          00000000 [0-9a-f]+ 00004d 00      0   0  1
   \[ 7\] .symtab           SYMTAB          00000000 [0-9a-f]+ 000060 10      8   6  4
   \[ 8\] .strtab           STRTAB          00000000 [0-9a-f]+ 000001 00      0   0  1
 Key to Flags:
diff --git a/gas/testsuite/gas/ia64/unwind.d b/gas/testsuite/gas/ia64/unwind.d
index e2bfdae..ce71a7a 100644
--- a/gas/testsuite/gas/ia64/unwind.d
+++ b/gas/testsuite/gas/ia64/unwind.d
@@ -18,7 +18,7 @@ Section Headers:
        0000000000000008  0000000000000000   A       0     0     8
   \[ 5\] \.IA_64\.unwind     IA_64_UNWIND     0000000000000000  00000048
        0000000000000008  0000000000000000  AL       1     1     8
-  \[ 6\] \.shstrtab         STRTAB           0000000000000000  00000050
+  \[ 6\] \.shstrtab         STRTAB           0000000000000000  [0-9a-f]+
        000000000000004d  0000000000000000           0     0     1
   \[ 7\] \.symtab           SYMTAB           0000000000000000  .*
        0000000000000090  0000000000000018           8     6     8
diff --git a/gas/testsuite/gas/tic6x/scomm-directive-4.d b/gas/testsuite/gas/tic6x/scomm-directive-4.d
index 1be90d0..18497ec 100644
--- a/gas/testsuite/gas/tic6x/scomm-directive-4.d
+++ b/gas/testsuite/gas/tic6x/scomm-directive-4.d
@@ -12,7 +12,7 @@ Section Headers:
   \[ 2\] \.data             PROGBITS        00000000 000034 000000 00  WA  0   0  1
   \[ 3\] \.bss              NOBITS          00000000 000034 000000 00  WA  0   0  1
   \[ 4\] \.c6xabi\.attribute C6000_ATTRIBUTE 00000000 000034 000013 00      0   0  1
-  \[ 5\] \.shstrtab         STRTAB          00000000 000047 00003f 00      0   0  1
+  \[ 5\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00003f 00      0   0  1
   \[ 6\] \.symtab           SYMTAB          00000000 [0-9a-f]+ 0000d0 10      7   5  4
   \[ 7\] \.strtab           STRTAB          00000000 [0-9a-f]+ 00001d 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
new file mode 100644
index 0000000..cd6042c
--- /dev/null
+++ b/ld/testsuite/ld-elf/compressed1d.d
@@ -0,0 +1,9 @@
+#source: compress1.s
+#as: --compress-debug-sections=none
+#ld: -r --compress-debug-sections=zlib-gnu
+#readelf: -SW
+
+#failif
+#...
+  \[[ 0-9]+\] \.zdebug_aranges[ 	]+(PROGBITS|MIPS_DWARF)[ 	0-9a-z]+ .*
+#...
diff --git a/ld/testsuite/ld-elf/compressed1e.d b/ld/testsuite/ld-elf/compressed1e.d
new file mode 100644
index 0000000..8f23347
--- /dev/null
+++ b/ld/testsuite/ld-elf/compressed1e.d
@@ -0,0 +1,9 @@
+#source: compress1.s
+#as: --compress-debug-sections=none
+#ld: -shared --compress-debug-sections=zlib-gnu
+#readelf: -SW
+
+#failif
+#...
+  \[[ 0-9]+\] \.zdebug_aranges[ 	]+(PROGBITS|MIPS_DWARF)[ 	0-9a-z]+ .*
+#...
diff --git a/ld/testsuite/ld-sh/sh64/crangerel1.rd b/ld/testsuite/ld-sh/sh64/crangerel1.rd
index fe0924e..90d71c5 100644
--- a/ld/testsuite/ld-sh/sh64/crangerel1.rd
+++ b/ld/testsuite/ld-sh/sh64/crangerel1.rd
@@ -10,7 +10,7 @@ Section Headers:
  +\[ 5\] \.stack +PROGBITS +00000000 00004c 000004 00 +WA +0 +0 +1
  +\[ 6\] \.cranges +PROGBITS +00000000 000050 00001e 00 +W +0 +0 +1
  +\[ 7\] \.rela\.cranges +RELA +00000000 [0-9a-f]+ 000024 0c +I +9 +6 +4
- +\[ 8\] \.shstrtab +STRTAB +00000000 00006e 00004d 00 +0 +0 +1
+ +\[ 8\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1
  +\[ 9\] \.symtab +SYMTAB .*
  +\[10\] \.strtab +STRTAB .*
 Key to Flags:
diff --git a/ld/testsuite/ld-sh/sh64/crangerel2.rd b/ld/testsuite/ld-sh/sh64/crangerel2.rd
index e343d3d..2daede7 100644
--- a/ld/testsuite/ld-sh/sh64/crangerel2.rd
+++ b/ld/testsuite/ld-sh/sh64/crangerel2.rd
@@ -10,7 +10,7 @@ Section Headers:
  +\[ 5\] \.stack +PROGBITS +00000000 000090 000004 00 +WA +0 +0 +1
  +\[ 6\] \.cranges +PROGBITS +00000000 000094 000046 00 +W +0 +0 +1
  +\[ 7\] \.rela\.cranges +RELA +00000000 [0-9a-f]+ 000054 0c +I +9 +6 +4
- +\[ 8\] \.shstrtab +STRTAB +00000000 0000da 00004d 00 +0 +0 +1
+ +\[ 8\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1
  +\[ 9\] \.symtab +SYMTAB +00000000 [0-9a-f]+ [0-9a-f]+ 10 +10 +[0-9]+ +4
  +\[10\] \.strtab +STRTAB +00000000 [0-9a-f]+ [0-9a-f]+ 00 +0 +0 +1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/common.d b/ld/testsuite/ld-tic6x/common.d
index 3a3942c..83f533d 100644
--- a/ld/testsuite/ld-tic6x/common.d
+++ b/ld/testsuite/ld-tic6x/common.d
@@ -11,7 +11,7 @@ Section Headers:
   \[ 0\]                   NULL            00000000 000000 000000 00      0   0  0
   \[ 1\] \.far              NOBITS          00000080 000080 000008 00  WA  0   0  4
   \[ 2\] \.bss              NOBITS          00000100 000080 000004 00  WA  0   0  4
-  \[ 3\] \.shstrtab         STRTAB          00000000 000054 000025 00      0   0  1
+  \[ 3\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000025 00      0   0  1
   \[ 4\] \.symtab           SYMTAB          00000000 [0-9a-f]+ 000050 10      5   3  4
   \[ 5\] \.strtab           STRTAB          00000000 [0-9a-f]+ 000005 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-1.rd b/ld/testsuite/ld-tic6x/shlib-1.rd
index 3d253d2..b4a3c30 100644
--- a/ld/testsuite/ld-tic6x/shlib-1.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        10000128 002128 000008 00  WA  0   0  4
   \[12\] \.bss              NOBITS          10000130 002130 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 002149 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-1b.rd b/ld/testsuite/ld-tic6x/shlib-1b.rd
index 3d253d2..b4a3c30 100644
--- a/ld/testsuite/ld-tic6x/shlib-1b.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1b.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        10000128 002128 000008 00  WA  0   0  4
   \[12\] \.bss              NOBITS          10000130 002130 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 002149 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-1r.rd b/ld/testsuite/ld-tic6x/shlib-1r.rd
index 3d253d2..b4a3c30 100644
--- a/ld/testsuite/ld-tic6x/shlib-1r.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1r.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        10000128 002128 000008 00  WA  0   0  4
   \[12\] \.bss              NOBITS          10000130 002130 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 002149 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-1rb.rd b/ld/testsuite/ld-tic6x/shlib-1rb.rd
index 3d253d2..b4a3c30 100644
--- a/ld/testsuite/ld-tic6x/shlib-1rb.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1rb.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        10000128 002128 000008 00  WA  0   0  4
   \[12\] \.bss              NOBITS          10000130 002130 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 002149 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1.rd b/ld/testsuite/ld-tic6x/shlib-app-1.rd
index 9c62d6b..23fb91c 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1.rd
@@ -17,7 +17,7 @@ Section Headers:
   \[12\] \.neardata         PROGBITS        100000c0 0020c0 00000c 00  WA  0   0  4
   \[13\] \.bss              NOBITS          100000cc 0020cc 000004 00  WA  0   0  4
   \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020cc 000019 00      0   0  1
-  \[15\] \.shstrtab         STRTAB          00000000 0020e5 000080 00      0   0  1
+  \[15\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000080 00      0   0  1
   \[16\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     17  [0-9]+  4
   \[17\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1b.rd b/ld/testsuite/ld-tic6x/shlib-app-1b.rd
index 8b5f5fa..7509e0a 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1b.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1b.rd
@@ -17,7 +17,7 @@ Section Headers:
   \[12\] \.neardata         PROGBITS        100000c0 0020c0 00000c 00  WA  0   0  4
   \[13\] \.bss              NOBITS          100000cc 0020cc 000004 00  WA  0   0  4
   \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020cc 000019 00      0   0  1
-  \[15\] \.shstrtab         STRTAB          00000000 0020e5 000080 00      0   0  1
+  \[15\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000080 00      0   0  1
   \[16\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     17  [0-9]+  4
   \[17\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1r.rd b/ld/testsuite/ld-tic6x/shlib-app-1r.rd
index a4737f5..ba0e84d 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1r.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1r.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        100000c0 0020c0 000004 00  WA  0   0  4
   \[12\] \.bss              NOBITS          100000c4 0020c4 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020c4 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 0020dd 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
index 7d70d9e..f7ff5a0 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
@@ -16,7 +16,7 @@ Section Headers:
   \[11\] \.neardata         PROGBITS        100000c0 0020c0 000004 00  WA  0   0  4
   \[12\] \.bss              NOBITS          100000c4 0020c4 000004 00  WA  0   0  4
   \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020c4 000019 00      0   0  1
-  \[14\] \.shstrtab         STRTAB          00000000 0020dd 00007b 00      0   0  1
+  \[14\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 00007b 00      0   0  1
   \[15\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     16  [0-9]+  4
   \[16\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/shlib-noindex.rd b/ld/testsuite/ld-tic6x/shlib-noindex.rd
index 2a9389c..aae19f7 100644
--- a/ld/testsuite/ld-tic6x/shlib-noindex.rd
+++ b/ld/testsuite/ld-tic6x/shlib-noindex.rd
@@ -17,7 +17,7 @@ Section Headers:
   \[12\] \.neardata         PROGBITS        10000128 002128 000008 00  WA  0   0  4
   \[13\] \.bss              NOBITS          10000130 002130 000004 00  WA  0   0  4
   \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00      0   0  1
-  \[15\] \.shstrtab         STRTAB          00000000 002149 000080 00      0   0  1
+  \[15\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000080 00      0   0  1
   \[16\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     17  [0-9]+  4
   \[17\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/static-app-1.rd b/ld/testsuite/ld-tic6x/static-app-1.rd
index 81a45f9..01ff975 100644
--- a/ld/testsuite/ld-tic6x/static-app-1.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1.rd
@@ -14,7 +14,7 @@ Section Headers:
   \[ 9\] \.neardata         PROGBITS        100000e0 0020e0 000014 00  WA  0   0  4
   \[10\] \.bss              NOBITS          100000f4 0020f4 000004 00  WA  0   0  4
   \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020f4 000019 00      0   0  1
-  \[12\] \.shstrtab         STRTAB          00000000 00210d 000071 00      0   0  1
+  \[12\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000071 00      0   0  1
   \[13\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     14  [0-9]+  4
   \[14\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/static-app-1b.rd b/ld/testsuite/ld-tic6x/static-app-1b.rd
index 81a45f9..01ff975 100644
--- a/ld/testsuite/ld-tic6x/static-app-1b.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1b.rd
@@ -14,7 +14,7 @@ Section Headers:
   \[ 9\] \.neardata         PROGBITS        100000e0 0020e0 000014 00  WA  0   0  4
   \[10\] \.bss              NOBITS          100000f4 0020f4 000004 00  WA  0   0  4
   \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020f4 000019 00      0   0  1
-  \[12\] \.shstrtab         STRTAB          00000000 00210d 000071 00      0   0  1
+  \[12\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000071 00      0   0  1
   \[13\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     14  [0-9]+  4
   \[14\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/static-app-1r.rd b/ld/testsuite/ld-tic6x/static-app-1r.rd
index 0ddcd63..041caf4 100644
--- a/ld/testsuite/ld-tic6x/static-app-1r.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1r.rd
@@ -14,7 +14,7 @@ Section Headers:
   \[ 9\] \.neardata         PROGBITS        100000e0 0020e0 00000c 00  WA  0   0  4
   \[10\] \.bss              NOBITS          100000ec 0020ec 000004 00  WA  0   0  4
   \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020ec 000019 00      0   0  1
-  \[12\] \.shstrtab         STRTAB          00000000 002105 000071 00      0   0  1
+  \[12\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000071 00      0   0  1
   \[13\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     14  [0-9]+  4
   \[14\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-tic6x/static-app-1rb.rd b/ld/testsuite/ld-tic6x/static-app-1rb.rd
index 0ddcd63..041caf4 100644
--- a/ld/testsuite/ld-tic6x/static-app-1rb.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1rb.rd
@@ -14,7 +14,7 @@ Section Headers:
   \[ 9\] \.neardata         PROGBITS        100000e0 0020e0 00000c 00  WA  0   0  4
   \[10\] \.bss              NOBITS          100000ec 0020ec 000004 00  WA  0   0  4
   \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020ec 000019 00      0   0  1
-  \[12\] \.shstrtab         STRTAB          00000000 002105 000071 00      0   0  1
+  \[12\] \.shstrtab         STRTAB          00000000 [0-9a-f]+ 000071 00      0   0  1
   \[13\] \.symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10     14  [0-9]+  4
   \[14\] \.strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
diff --git a/ld/testsuite/ld-x86-64/ilp32-4.d b/ld/testsuite/ld-x86-64/ilp32-4.d
index df3e94c..6b63e5a 100644
--- a/ld/testsuite/ld-x86-64/ilp32-4.d
+++ b/ld/testsuite/ld-x86-64/ilp32-4.d
@@ -13,7 +13,7 @@ Section Headers:
   \[ 3\] .dynstr           STRTAB          00000120 000120 000019 00   A  0   0  1
   \[ 4\] .text             PROGBITS        00000139 000139 000001 00  AX  0   0  1
   \[ 5\] .dynamic          DYNAMIC         0020013c 00013c 000058 08  WA  3   0  4
-  \[ 6\] .shstrtab         STRTAB          00000000 000194 000040 00      0   0  1
+  \[ 6\] .shstrtab         STRTAB          00000000 [0-9a-f]+ 000040 00      0   0  1
   \[ 7\] .symtab           SYMTAB          00000000 [0-9a-f]+ [0-9a-f]+ 10      8   [0-9]  4
   \[ 8\] .strtab           STRTAB          00000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1
 Key to Flags:
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 edc3e0b..340c5fc 100644
--- a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
+++ b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
@@ -8,7 +8,7 @@ Section Headers:
   \[ 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
+  \[ 6\] .shstrtab         STRTAB          0000000000000000 [0-9a-f]+ 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:
diff --git a/ld/testsuite/ld-x86-64/split-by-file.rd b/ld/testsuite/ld-x86-64/split-by-file.rd
index edc3e0b..340c5fc 100644
--- a/ld/testsuite/ld-x86-64/split-by-file.rd
+++ b/ld/testsuite/ld-x86-64/split-by-file.rd
@@ -8,7 +8,7 @@ Section Headers:
   \[ 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
+  \[ 6\] .shstrtab         STRTAB          0000000000000000 [0-9a-f]+ 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]