* [patch/commited] vms: make code section read-only
@ 2011-03-25 15:31 Tristan Gingold
0 siblings, 0 replies; only message in thread
From: Tristan Gingold @ 2011-03-25 15:31 UTC (permalink / raw)
To: binutils
Hi,
code sections were not flagged as read-only even if they were. This patch fixes that.
Applied on trunk.
Tristan.
bfd/
2011-03-25 Tristan Gingold <gingold@adacore.com>
* vms-alpha.c (evax_section_flags): Make $CODE$ section read-only.
Minor reordering.
(alpha_vms_create_eisd_for_section): Make code sections read-only.
Index: vms-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-alpha.c,v
retrieving revision 1.40
diff -c -p -r1.40 vms-alpha.c
*** vms-alpha.c 15 Feb 2011 09:35:42 -0000 1.40
--- vms-alpha.c 25 Mar 2011 15:24:14 -0000
*************** static const struct sec_flags_struct eva
*** 945,963 ****
0 },
{ EVAX_CODE_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
! SEC_CODE,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
! SEC_CODE | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LITERAL_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD | EGPS__V_NOMOD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD,
! SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
{ EVAX_LINK_NAME,
EGPS__V_REL | EGPS__V_RD,
SEC_DATA | SEC_READONLY,
EGPS__V_REL | EGPS__V_RD,
! SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
{ EVAX_DATA_NAME,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT | EGPS__V_NOMOD,
SEC_DATA,
--- 945,963 ----
0 },
{ EVAX_CODE_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
! SEC_CODE | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
! SEC_CODE | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LITERAL_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD | EGPS__V_NOMOD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD,
! SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LINK_NAME,
EGPS__V_REL | EGPS__V_RD,
SEC_DATA | SEC_READONLY,
EGPS__V_REL | EGPS__V_RD,
! SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_DATA_NAME,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT | EGPS__V_NOMOD,
SEC_DATA,
*************** static const struct sec_flags_struct eva
*** 972,983 ****
EGPS__V_PIC | EGPS__V_REL | EGPS__V_RD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_RD,
! SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
{ EVAX_READONLY_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD | EGPS__V_NOMOD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD,
! SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
{ EVAX_LOCAL_NAME,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT,
SEC_DATA,
--- 972,983 ----
EGPS__V_PIC | EGPS__V_REL | EGPS__V_RD,
! SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ NULL,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT,
SEC_DATA,
*************** alpha_vms_create_eisd_for_section (bfd *
*** 2901,2907 ****
if (sec->flags & SEC_CODE)
eisd->u.eisd.flags |= EISD__M_EXE;
! else if (!(sec->flags & SEC_READONLY))
eisd->u.eisd.flags |= EISD__M_WRT | EISD__M_CRF;
/* If relocations or fixup will be applied, make this isect writeable. */
--- 2901,2907 ----
if (sec->flags & SEC_CODE)
eisd->u.eisd.flags |= EISD__M_EXE;
! if (!(sec->flags & SEC_READONLY))
eisd->u.eisd.flags |= EISD__M_WRT | EISD__M_CRF;
/* If relocations or fixup will be applied, make this isect writeable. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-25 15:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 15:31 [patch/commited] vms: make code section read-only Tristan Gingold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).