diff options
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index ed152ab..a968dd0 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -591,6 +591,15 @@ DEFUN (wild_doit, (ptr, section, output, file), if (output->bfd_section == (asection *) NULL) { init_os (output); + /* Initialize the vma and size to the existing section. This will + be overriden in lang_size_sections unless SEC_NEVER_LOAD gets + set. */ + if (section != (asection *) NULL) + { + bfd_set_section_vma (0, output->bfd_section, + bfd_section_vma (0, section)); + output->bfd_section->_raw_size = section->_raw_size; + } } if (section != (asection *) NULL @@ -1486,6 +1495,11 @@ DEFUN (lang_size_sections, (s, output_section_statement, prev, fill, bfd_vma after; lang_output_section_statement_type *os = &s->output_section_statement; + /* If this section is never loaded, don't change the size and + address. */ + if (os->bfd_section->flags & SEC_NEVER_LOAD) + break; + if (os->bfd_section == &bfd_abs_section) { /* No matter what happens, an abs section starts at zero */ |