When deciding if ".text" section should be read-only, don't forget to reset
SEC_READONLY because it could be already set.
This commit is contained in:
parent
863e0fe46a
commit
1f0df59a27
2 changed files with 17 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2000-05-22 Igor Shevlyakov <igor@windriver.com>
|
||||||
|
|
||||||
|
* ldmain.c (main): When deciding if ".text" section should be
|
||||||
|
read-only, don't forget to reset SEC_READONLY because it
|
||||||
|
could be already set.
|
||||||
|
|
||||||
2000-05-22 Thomas de Lellis <tdel@windriver.com>
|
2000-05-22 Thomas de Lellis <tdel@windriver.com>
|
||||||
|
|
||||||
* ld.1: Add documentation for new command line option:
|
* ld.1: Add documentation for new command line option:
|
||||||
|
|
|
@ -347,15 +347,16 @@ main (argc, argv)
|
||||||
/* Print error messages for any missing symbols, for any warning
|
/* Print error messages for any missing symbols, for any warning
|
||||||
symbols, and possibly multiple definitions */
|
symbols, and possibly multiple definitions */
|
||||||
|
|
||||||
|
/* Look for a text section and switch the readonly attribute in it. */
|
||||||
if (config.text_read_only)
|
|
||||||
{
|
{
|
||||||
/* Look for a text section and mark the readonly attribute in it */
|
|
||||||
asection * found = bfd_get_section_by_name (output_bfd, ".text");
|
asection * found = bfd_get_section_by_name (output_bfd, ".text");
|
||||||
|
|
||||||
if (found != (asection *) NULL)
|
if (found != (asection *) NULL)
|
||||||
{
|
{
|
||||||
|
if (config.text_read_only)
|
||||||
found->flags |= SEC_READONLY;
|
found->flags |= SEC_READONLY;
|
||||||
|
else
|
||||||
|
found->flags &= ~SEC_READONLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue