This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Don't check caches_rawsize in elf_link_input_bfd
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Fri, 29 Apr 2016 04:10:04 -0700
- Subject: [PATCH] Don't check caches_rawsize in elf_link_input_bfd
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
When backend caches the section contents, the .eh_frame section size
may be increased due to DW_EH_PE_pcrel address encoding conversion
even if caches_rawsize isn't set. ld-elf/eh6.d is such an example.
We shouldn't check caches_rawsize to support section size increase.
OK for master?
H.J.
---
* elflink.c (elf_link_input_bfd): Don't caches_rawsize to
support section size increase.
---
bfd/elflink.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 021db68..20f75f6 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -10054,14 +10054,15 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
}
/* Get the contents of the section. They have been cached by a
- relaxation routine. Note that o is a section in an input
- file, so the contents field will not have been set by any of
- the routines which work on output files. */
+ relaxation or check_relocs routines. The .eh_frame section
+ size may be increased due to DW_EH_PE_pcrel address encoding
+ conversion. Note that o is a section in an input file, so the
+ contents field will not have been set by any of the routines
+ which work on output files. */
if (elf_section_data (o)->this_hdr.contents != NULL)
{
contents = elf_section_data (o)->this_hdr.contents;
- if (bed->caches_rawsize
- && o->rawsize != 0
+ if (o->rawsize != 0
&& o->rawsize < o->size)
{
memcpy (flinfo->contents, contents, o->rawsize);
--
2.5.5