+ case lang_output_section_statement_enum:
+ {
+ bfd_vma after;
+ lang_output_section_statement_type *os = &s->output_section_statement;
+
+ /* If this is a shared library section, don't change the size
+ and address. */
+ if (os->bfd_section->flags & SEC_SHARED_LIBRARY)
+ break;
+
+ if (os->bfd_section == &bfd_abs_section)
+ {
+ /* No matter what happens, an abs section starts at zero */
+ bfd_set_section_vma (0, os->bfd_section, 0);
+ }
+ else
+ {
+ if (os->addr_tree == (etree_type *) NULL)
+ {
+ /* No address specified for this section, get one
+ from the region specification
+ */
+ if (os->region == (lang_memory_region_type *) NULL)
+ {
+ os->region = lang_memory_region_lookup ("*default*");
+ }
+ dot = os->region->current;
+ }
+ else
+ {
+ etree_value_type r;
+
+ r = exp_fold_tree (os->addr_tree,
+ abs_output_section,
+ lang_allocating_phase_enum,
+ dot, &dot);
+ if (r.valid == false)
+ {
+ einfo ("%F%S: non constant address expression for section %s\n",
+ os->name);
+ }
+ dot = r.value;
+ }
+ /* The section starts here */
+ /* First, align to what the section needs */
+
+
+ dot = align_power (dot, os->bfd_section->alignment_power);
+ bfd_set_section_vma (0, os->bfd_section, dot);
+ }
+
+
+ os->bfd_section->output_offset = 0;
+
+ (void) lang_size_sections (os->children.head, os, &os->children.head,
+ os->fill, dot, relax);
+ /* Ignore the size of the input sections, use the vma and size to */
+ /* align against */
+
+
+ after = ALIGN (os->bfd_section->vma +
+ os->bfd_section->_raw_size,
+ os->block_value);
+
+
+ os->bfd_section->_raw_size = after - os->bfd_section->vma;
+ dot = os->bfd_section->vma + os->bfd_section->_raw_size;
+ os->processed = true;
+
+ /* Replace into region ? */
+ if (os->addr_tree == (etree_type *) NULL
+ && os->region != (lang_memory_region_type *) NULL)
+ {
+ os->region->current = dot;
+ /* Make sure this isn't silly */
+ if (os->region->current >
+ os->region->origin +
+ os->region->length)
+ {
+ einfo ("%X%P: Region %s is full (%B section %s)\n",
+ os->region->name,
+ os->bfd_section->owner,
+ os->bfd_section->name);
+ /* Reset the region pointer */
+ os->region->current = 0;
+
+ }
+
+ }
+ }