diff options
author | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-28 14:30:45 +0000 |
---|---|---|
committer | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-28 14:30:45 +0000 |
commit | a2bff217a0e1444310cfabb816396231fd3ce0d7 (patch) | |
tree | a3ae4df0be5288980fc6b2019809ca8e2cdfab1c | |
parent | eb219e9ce0b4875e3682265c9d0597f82cc5c8dc (diff) | |
download | gcc-a2bff217a0e1444310cfabb816396231fd3ce0d7.tar.gz |
* lto-opts.c (lto_file_read_options): Add loop over all inputs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162633 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/lto-opts.c | 34 |
2 files changed, 29 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2fe41f7a9f..d7fc0efbb45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2010-07-28 Andi Kleen <ak@linux.intel.com> + + * lto-opts.c (lto_file_read_options): Add loop over all inputs. + 2010-07-28 Richard Guenther <rguenther@suse.de> PR middle-end/44903 diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c index fa52f953608..bff03259141 100644 --- a/gcc/lto-opts.c +++ b/gcc/lto-opts.c @@ -349,8 +349,8 @@ input_options (struct lto_input_block *ib) void lto_read_file_options (struct lto_file_decl_data *file_data) { - size_t len; - const char *data; + size_t len, l, skip; + const char *data, *p; const struct lto_simple_header *header; int32_t opts_offset; struct lto_input_block ib; @@ -358,14 +358,30 @@ lto_read_file_options (struct lto_file_decl_data *file_data) data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len); if (!data) return; - header = (const struct lto_simple_header *) data; - opts_offset = sizeof (*header); - lto_check_version (header->lto_header.major_version, - header->lto_header.minor_version); - - LTO_INIT_INPUT_BLOCK (ib, data + opts_offset, 0, header->main_size); - input_options (&ib); + /* Option could be multiple sections merged (through ld -r) + Keep reading all options. This is ok right now because + the options just get mashed together anyways. + This will have to be done differently once lto-opts knows + how to associate options with different files. */ + l = len; + p = data; + do + { + header = (const struct lto_simple_header *) p; + opts_offset = sizeof (*header); + + lto_check_version (header->lto_header.major_version, + header->lto_header.minor_version); + + LTO_INIT_INPUT_BLOCK (ib, p + opts_offset, 0, header->main_size); + input_options (&ib); + + skip = header->main_size + opts_offset; + l -= skip; + p += skip; + } + while (l > 0); lto_free_section_data (file_data, LTO_section_opts, 0, data, len); } |