This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch/commited] vms: make code section read-only
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Fri, 25 Mar 2011 16:31:11 +0100
- Subject: [patch/commited] vms: make code section read-only
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. */