Align .gnu_debuglink sections on a 4-byte boundary.
PR binutils/21193 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly created section 4-byte alignment.
This commit is contained in:
parent
25890fc239
commit
758d96d834
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2017-02-22 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR binutils/21193
|
||||||
|
* opncls.c (bfd_create_gnu_debuglink_section): Give the newly
|
||||||
|
created section 4-byte alignment.
|
||||||
|
|
||||||
2017-02-22 Alan Modra <amodra@gmail.com>
|
2017-02-22 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
|
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
|
||||||
|
|
|
@ -1645,6 +1645,8 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
|
||||||
if (sect == NULL)
|
if (sect == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
/* Compute the size of the section. Allow for the CRC after the filename,
|
||||||
|
and padding so that it will start on a 4-byte boundary. */
|
||||||
debuglink_size = strlen (filename) + 1;
|
debuglink_size = strlen (filename) + 1;
|
||||||
debuglink_size += 3;
|
debuglink_size += 3;
|
||||||
debuglink_size &= ~3;
|
debuglink_size &= ~3;
|
||||||
|
@ -1654,6 +1656,11 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
|
||||||
/* XXX Should we delete the section from the bfd ? */
|
/* XXX Should we delete the section from the bfd ? */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
/* PR 21193: Ensure that the section has 4-byte alignment for the CRC.
|
||||||
|
Note - despite the name of the function being called, we are
|
||||||
|
setting an alignment power, not a byte alignment value. */
|
||||||
|
bfd_set_section_alignment (abfd, sect, 2);
|
||||||
|
|
||||||
return sect;
|
return sect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue