/* The section contains thread local data. */
#define SEC_THREAD_LOCAL 0x400
+ /* The section's size is fixed. Generic linker code will not
+ recalculate it and it is up to whoever has set this flag to
+ get the size right. */
+#define SEC_FIXED_SIZE 0x800
+
/* The section contains common symbols (symbols may be defined
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
. {* The section contains thread local data. *}
.#define SEC_THREAD_LOCAL 0x400
.
+. {* The section's size is fixed. Generic linker code will not
+. recalculate it and it is up to whoever has set this flag to
+. get the size right. *}
+.#define SEC_FIXED_SIZE 0x800
+.
. {* The section contains common symbols (symbols may be defined
. multiple times, the value of a symbol is the amount of
. space it requires, and the largest symbol value is the one
+2018-02-19 Maciej W. Rozycki <macro@mips.com>
+
+ * ldlang.c (insert_pad): Do not change output section's size if
+ SEC_FIXED_SIZE is set in the flags.
+ (size_input_section): Likewise.
+ (lang_size_sections_1): Likewise.
+ (lang_reset_memory_regions): Likewise.
+
2018-02-19 Alan Modra <amodra@gmail.com>
* ldmisc.c (vfinfo) Handle %pI, %pR, %pS and %pT in place of
}
pad->padding_statement.output_offset = dot - output_section->vma;
pad->padding_statement.size = alignment_needed;
- output_section->size = TO_SIZE (dot + TO_ADDR (alignment_needed)
- - output_section->vma);
+ if (!(output_section->flags & SEC_FIXED_SIZE))
+ output_section->size = TO_SIZE (dot + TO_ADDR (alignment_needed)
+ - output_section->vma);
}
/* Work out how much this section will move the dot point. */
/* Mark how big the output section must be to contain this now. */
dot += TO_ADDR (i->size);
- o->size = TO_SIZE (dot - o->vma);
+ if (!(o->flags & SEC_FIXED_SIZE))
+ o->size = TO_SIZE (dot - o->vma);
}
return dot;
bfd_set_section_vma (os->bfd_section->owner,
os->bfd_section,
bfd_section_vma (input->owner, input));
- os->bfd_section->size = input->size;
+ if (!(os->bfd_section->flags & SEC_FIXED_SIZE))
+ os->bfd_section->size = input->size;
break;
}
+ os->block_value - 1)
& - (bfd_vma) os->block_value);
- os->bfd_section->size = TO_SIZE (after - os->bfd_section->vma);
+ if (!(os->bfd_section->flags & SEC_FIXED_SIZE))
+ os->bfd_section->size = TO_SIZE (after
+ - os->bfd_section->vma);
}
/* Set section lma. */
if (size < TO_SIZE ((unsigned) 1))
size = TO_SIZE ((unsigned) 1);
dot += TO_ADDR (size);
- output_section_statement->bfd_section->size
- = TO_SIZE (dot - output_section_statement->bfd_section->vma);
+ if (!(output_section_statement->bfd_section->flags
+ & SEC_FIXED_SIZE))
+ output_section_statement->bfd_section->size
+ = TO_SIZE (dot - output_section_statement->bfd_section->vma);
}
break;
output_section_statement->bfd_section;
size = bfd_get_reloc_size (s->reloc_statement.howto);
dot += TO_ADDR (size);
- output_section_statement->bfd_section->size
- = TO_SIZE (dot - output_section_statement->bfd_section->vma);
+ if (!(output_section_statement->bfd_section->flags
+ & SEC_FIXED_SIZE))
+ output_section_statement->bfd_section->size
+ = TO_SIZE (dot - output_section_statement->bfd_section->vma);
}
break;
{
/* Save the last size for possible use by bfd_relax_section. */
o->rawsize = o->size;
- o->size = 0;
+ if (!(o->flags & SEC_FIXED_SIZE))
+ o->size = 0;
}
}