GCC Bugzilla – Attachment 38885 Details for
Bug 69880
Linking Windows resource + implicit 'default-manifest.o' creates bad .exe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
pr69880_2.25_peXXigen.c.patch (text/plain), 2.17 KB, created by
Nick Clifton
on 2016-07-13 12:20:51 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Nick Clifton
Created:
2016-07-13 12:20:51 UTC
Size:
2.17 KB
patch
obsolete
>diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c >index c09779a..a51b384 100644 >--- a/bfd/peXXigen.c >+++ b/bfd/peXXigen.c >@@ -4097,6 +4097,8 @@ rsrc_process_section (bfd * abfd, > unsigned int num_input_rsrc = 0; > unsigned int max_num_input_rsrc = 4; > ptrdiff_t * rsrc_sizes = NULL; >+ unsigned long page_size; >+ > > new_table.names.num_entries = 0; > new_table.ids.num_entries = 0; >@@ -4139,7 +4141,8 @@ rsrc_process_section (bfd * abfd, > { > asection * rsrc_sec = bfd_get_section_by_name (input, ".rsrc"); > >- if (rsrc_sec != NULL) >+ /* PR 18372 - skip discarded .rsrc sections. */ >+ if (rsrc_sec != NULL && !discarded_section (rsrc_sec)) > { > if (num_input_rsrc == max_num_input_rsrc) > { >@@ -4274,22 +4277,25 @@ rsrc_process_section (bfd * abfd, > We recompute the size as we may have lost entries due to mergeing. */ > size = ((write_data.next_data - new_data) + 3) & ~ 3; > >- { >- int page_size; >- >- if (coff_data (abfd)->link_info) >- { >- page_size = pe_data (abfd)->pe_opthdr.FileAlignment; >+ if (coff_data (abfd)->link_info) >+ { >+ page_size = pe_data (abfd)->pe_opthdr.FileAlignment; > >- /* If no file alignment has been set, default to one. >- This repairs 'ld -r' for arm-wince-pe target. */ >- if (page_size == 0) >- page_size = 1; >- } >- else >- page_size = PE_DEF_FILE_ALIGNMENT; >- size = (size + page_size - 1) & - page_size; >- } >+ /* If no file alignment has been set, default to one. >+ This repairs 'ld -r' for arm-wince-pe target. */ >+ if (page_size == 0) >+ page_size = 1; >+ } >+ else >+ page_size = PE_DEF_FILE_ALIGNMENT; >+ >+ size = (size + page_size - 1) & - page_size; >+ /* PR gcc/69880: We must ensure that there are no gaps between the end >+ of the .rsrc section and whichever section comes next in the file. >+ This does mean that we can end up with a lot of unused space at >+ the end of the .rsrc section, but at least this way works. */ >+ if (sec->next && sec->next->filepos > (file_ptr)(sec->filepos + size)) >+ size = sec->next->filepos - sec->filepos; > > bfd_set_section_contents (pfinfo->output_bfd, sec, new_data, 0, size); > sec->size = sec->rawsize = size;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 69880
:
38883
|
38884
| 38885