+2023-09-27 Hsinyuan Xavier <TheLastLin@hotmail.com>
+
+ PR 30875
+ * ldlang.c (get_os_init_flag): New function.
+ (exp_init_os, map_input_to_output_sections): Use it.
+
2023-07-24 Johannes Schauer Marin Rodrigues <josch@debian.org>
* pe-dll.c (fill_edata): If inserting a timestamp, use the value
"section alignment");
}
+static flagword
+get_os_init_flag (lang_output_section_statement_type * os)
+{
+ if (os != NULL)
+ switch (os->sectype)
+ {
+ case readonly_section: return SEC_READONLY;
+ case noload_section: return SEC_NEVER_LOAD;
+ default: break;
+ }
+
+ return 0;
+}
+
/* Make sure that all output sections mentioned in an expression are
initialized. */
os = lang_output_section_find (exp->name.name);
if (os != NULL && os->bfd_section == NULL)
- init_os (os, 0);
+ init_os (os, get_os_init_flag (os));
}
}
break;
if (os != NULL && os->bfd_section == NULL)
init_os (os, 0);
break;
+
case lang_assignment_statement_enum:
if (os != NULL && os->bfd_section == NULL)
- init_os (os, 0);
+ init_os (os, get_os_init_flag (os));
/* Make sure that any sections mentioned in the assignment
are initialized. */
exp_init_os (s->assignment_statement.exp);
break;
+
case lang_address_statement_enum:
/* Mark the specified section with the supplied address.
If this section was actually a segment marker, then the