mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
* ldmain.c (main): Move .text readonly flag fudges from here..
* ldlang.c (lang_process): ..to here.
This commit is contained in:
parent
1868c04eba
commit
862120bdbe
@ -1,3 +1,8 @@
|
||||
2002-03-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ldmain.c (main): Move .text readonly flag fudges from here..
|
||||
* ldlang.c (lang_process): ..to here.
|
||||
|
||||
2002-03-14 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ldlang.c (lang_check): Remove the word size check added in last
|
||||
|
16
ld/ldlang.c
16
ld/ldlang.c
@ -4198,6 +4198,22 @@ lang_process ()
|
||||
/* Find any sections not attached explicitly and handle them. */
|
||||
lang_place_orphans ();
|
||||
|
||||
if (! link_info.relocateable)
|
||||
{
|
||||
/* Look for a text section and set 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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do anything special before sizing sections. This is where ELF
|
||||
and other back-ends size dynamic sections. */
|
||||
ldemul_before_allocation ();
|
||||
|
||||
/* We must record the program headers before we try to fix the
|
||||
|
14
ld/ldmain.c
14
ld/ldmain.c
@ -404,20 +404,6 @@ main (argc, argv)
|
||||
/* Print error messages for any missing symbols, for any warning
|
||||
symbols, and possibly multiple definitions. */
|
||||
|
||||
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 (link_info.relocateable)
|
||||
output_bfd->flags &= ~EXEC_P;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user