mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-05 21:50:21 +08:00
Correctly set SEC_READONLY for .text section.
This commit is contained in:
23
ld/ldmain.c
23
ld/ldmain.c
@ -348,18 +348,19 @@ main (argc, argv)
|
||||
/* Print error messages for any missing symbols, for any warning
|
||||
symbols, and possibly multiple definitions */
|
||||
|
||||
/* Look for a text section and switch the readonly attribute in it. */
|
||||
{
|
||||
asection * found = bfd_get_section_by_name (output_bfd, ".text");
|
||||
if (! link_info.relocateable)
|
||||
{
|
||||
/* Look for a text section and switch the readonly attribute in it. */
|
||||
asection * found = bfd_get_section_by_name (output_bfd, ".text");
|
||||
|
||||
if (found != (asection *) NULL)
|
||||
{
|
||||
if (config.text_read_only)
|
||||
found->flags |= SEC_READONLY;
|
||||
else
|
||||
found->flags &= ~SEC_READONLY;
|
||||
}
|
||||
}
|
||||
if (found != (asection *) NULL)
|
||||
{
|
||||
if (config.text_read_only)
|
||||
found->flags |= SEC_READONLY;
|
||||
else
|
||||
found->flags &= ~SEC_READONLY;
|
||||
}
|
||||
}
|
||||
|
||||
if (link_info.relocateable)
|
||||
output_bfd->flags &= ~EXEC_P;
|
||||
|
Reference in New Issue
Block a user