[ARM] Change noread to purecode.

bfd/ChangeLog
2016-07-05  Andre Vieria  <andre.simoesdiasvieira@arm.com>

        * bfd-in2.h (SEC_ELF_NOREAD): Rename to ...
          (SEC_ELF_PURECODE): ... this.
        * elf32-arm.c (elf32_arm_post_process_headers): Rename SEC_ELF_NOREAD
          to SEC_ELF_NOREAD.
          (elf32_arm_fake_sections): Likewise.
          (elf_32_arm_section_flags): Likewise.
          (elf_32_arm_lookup_section_flags): Likewise.
        * section.c (SEC_ELF_NOREAD): Rename to ...
          (SEC_ELF_PURECODE): ... this.

binutils/ChangeLog
2016-07-05  Andre Vieria  <andre.simoesdiasvieira@arm.com>

        * objdump.c (dump_section_header): Rename SEC_ELF_NOREAD
          to SEC_ELF_NOREAD.
        * readelf.c (get_elf_section_flags): Rename ARM_NOREAD to
          ARM_PURECODE and SHF_ARM_NOREAD to SHF_ARM_PURECODE.
          (process_section_headers): Rename noread to purecode.

        * section.c (SEC_ELF_NOREAD): Rename to ...
          (SEC_ELF_PURECODE): ... this.

include/ChangeLog
2016-07-05  Andre Vieria  <andre.simoesdiasvieira@arm.com>

        * elf/arm.h (SHF_ARM_NOREAD): Rename to ...
          (SHF_ARM_PURECODE): ... this.

ld/ChangeLog
2016-07-05  Andre Vieria  <andre.simoesdiasvieira@arm.com>

        * testsuite/ld-arm/arm_noread.ld: Renamed to ...
          testsuite/ld-arm/arm_purecode.ld: ... this, and replaced
          all noread's by purecode.
This commit is contained in:
Andre Vieria
2016-07-05 11:28:46 +01:00
committed by Richard Earnshaw
parent 1753ed6811
commit f0728ee368
11 changed files with 56 additions and 27 deletions

View File

@ -1,3 +1,15 @@
2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com>
* bfd-in2.h (SEC_ELF_NOREAD): Rename to ...
(SEC_ELF_PURECODE): ... this.
* elf32-arm.c (elf32_arm_post_process_headers): Rename SEC_ELF_NOREAD
to SEC_ELF_NOREAD.
(elf32_arm_fake_sections): Likewise.
(elf_32_arm_section_flags): Likewise.
(elf_32_arm_lookup_section_flags): Likewise.
* section.c (SEC_ELF_NOREAD): Rename to ...
(SEC_ELF_PURECODE): ... this.
2016-07-01 Thomas Preud'homme <thomas.preudhomme@arm.com> 2016-07-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
* elf32-arm.c (using_thumb2_bl): New function. * elf32-arm.c (using_thumb2_bl): New function.

View File

@ -1428,8 +1428,8 @@ typedef struct bfd_section
when memory read flag isn't set. */ when memory read flag isn't set. */
#define SEC_COFF_NOREAD 0x40000000 #define SEC_COFF_NOREAD 0x40000000
/* Indicate that section has the no read flag set. */ /* Indicate that section has the purecode flag set. */
#define SEC_ELF_NOREAD 0x80000000 #define SEC_ELF_PURECODE 0x80000000
/* End of section flags. */ /* End of section flags. */

View File

@ -15812,7 +15812,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
} }
/* Scan segment to set p_flags attribute if it contains only sections with /* Scan segment to set p_flags attribute if it contains only sections with
SHF_ARM_NOREAD flag. */ SHF_ARM_PURECODE flag. */
for (m = elf_seg_map (abfd); m != NULL; m = m->next) for (m = elf_seg_map (abfd); m != NULL; m = m->next)
{ {
unsigned int j; unsigned int j;
@ -15821,7 +15821,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
continue; continue;
for (j = 0; j < m->count; j++) for (j = 0; j < m->count; j++)
{ {
if (!(elf_section_flags (m->sections[j]) & SHF_ARM_NOREAD)) if (!(elf_section_flags (m->sections[j]) & SHF_ARM_PURECODE))
break; break;
} }
if (j == m->count) if (j == m->count)
@ -15884,8 +15884,8 @@ elf32_arm_fake_sections (bfd * abfd, Elf_Internal_Shdr * hdr, asection * sec)
hdr->sh_flags |= SHF_LINK_ORDER; hdr->sh_flags |= SHF_LINK_ORDER;
} }
if (sec->flags & SEC_ELF_NOREAD) if (sec->flags & SEC_ELF_PURECODE)
hdr->sh_flags |= SHF_ARM_NOREAD; hdr->sh_flags |= SHF_ARM_PURECODE;
return TRUE; return TRUE;
} }
@ -18171,16 +18171,16 @@ elf32_arm_get_synthetic_symtab (bfd *abfd,
static bfd_boolean static bfd_boolean
elf32_arm_section_flags (flagword *flags, const Elf_Internal_Shdr * hdr) elf32_arm_section_flags (flagword *flags, const Elf_Internal_Shdr * hdr)
{ {
if (hdr->sh_flags & SHF_ARM_NOREAD) if (hdr->sh_flags & SHF_ARM_PURECODE)
*flags |= SEC_ELF_NOREAD; *flags |= SEC_ELF_PURECODE;
return TRUE; return TRUE;
} }
static flagword static flagword
elf32_arm_lookup_section_flags (char *flag_name) elf32_arm_lookup_section_flags (char *flag_name)
{ {
if (!strcmp (flag_name, "SHF_ARM_NOREAD")) if (!strcmp (flag_name, "SHF_ARM_PURECODE"))
return SHF_ARM_NOREAD; return SHF_ARM_PURECODE;
return SEC_NO_FLAGS; return SEC_NO_FLAGS;
} }

View File

@ -361,8 +361,8 @@ CODE_FRAGMENT
. when memory read flag isn't set. *} . when memory read flag isn't set. *}
.#define SEC_COFF_NOREAD 0x40000000 .#define SEC_COFF_NOREAD 0x40000000
. .
. {* Indicate that section has the no read flag set. *} . {* Indicate that section has the purecode flag set. *}
.#define SEC_ELF_NOREAD 0x80000000 .#define SEC_ELF_PURECODE 0x80000000
. .
. {* End of section flags. *} . {* End of section flags. *}
. .

View File

@ -1,3 +1,14 @@
2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com>
* objdump.c (dump_section_header): Rename SEC_ELF_NOREAD
to SEC_ELF_NOREAD.
* readelf.c (get_elf_section_flags): Rename ARM_NOREAD to
ARM_PURECODE and SHF_ARM_NOREAD to SHF_ARM_PURECODE.
(process_section_headers): Rename noread to purecode.
* section.c (SEC_ELF_NOREAD): Rename to ...
(SEC_ELF_PURECODE): ... this.
2016-07-01 Nick Clifton <nickc@redhat.com> 2016-07-01 Nick Clifton <nickc@redhat.com>
* prdbg.c (pr_enum_type): Use a buffer big enough to hold an * prdbg.c (pr_enum_type): Use a buffer big enough to hold an

View File

@ -493,12 +493,7 @@ dump_section_header (bfd *abfd, asection *section,
PF (SEC_COFF_NOREAD, "NOREAD"); PF (SEC_COFF_NOREAD, "NOREAD");
} }
else if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) else if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
{ PF (SEC_ELF_PURECODE, "PURECODE");
/* Note - sections can have both the READONLY and NOREAD attributes
set. In this case the NOREAD takes precedence, but we report both
since the user may need to know that both bits are set. */
PF (SEC_ELF_NOREAD, "NOREAD");
}
PF (SEC_THREAD_LOCAL, "THREAD_LOCAL"); PF (SEC_THREAD_LOCAL, "THREAD_LOCAL");
PF (SEC_GROUP, "GROUP"); PF (SEC_GROUP, "GROUP");
if (bfd_get_arch (abfd) == bfd_arch_mep) if (bfd_get_arch (abfd) == bfd_arch_mep)

View File

@ -5399,7 +5399,7 @@ get_elf_section_flags (bfd_vma sh_flags)
/* 20 */ { STRING_COMMA_LEN ("COMPRESSED") }, /* 20 */ { STRING_COMMA_LEN ("COMPRESSED") },
/* ARM specific. */ /* ARM specific. */
/* 21 */ { STRING_COMMA_LEN ("ENTRYSECT") }, /* 21 */ { STRING_COMMA_LEN ("ENTRYSECT") },
/* 22 */ { STRING_COMMA_LEN ("ARM_NOREAD") }, /* 22 */ { STRING_COMMA_LEN ("ARM_PURECODE") },
/* 23 */ { STRING_COMMA_LEN ("COMDEF") } /* 23 */ { STRING_COMMA_LEN ("COMDEF") }
}; };
@ -5475,7 +5475,7 @@ get_elf_section_flags (bfd_vma sh_flags)
switch (flag) switch (flag)
{ {
case SHF_ENTRYSECT: sindex = 21; break; case SHF_ENTRYSECT: sindex = 21; break;
case SHF_ARM_NOREAD: sindex = 22; break; case SHF_ARM_PURECODE: sindex = 22; break;
case SHF_COMDEF: sindex = 23; break; case SHF_COMDEF: sindex = 23; break;
default: break; default: break;
} }
@ -5534,7 +5534,7 @@ get_elf_section_flags (bfd_vma sh_flags)
&& flag == SHF_X86_64_LARGE) && flag == SHF_X86_64_LARGE)
*p = 'l'; *p = 'l';
else if (elf_header.e_machine == EM_ARM else if (elf_header.e_machine == EM_ARM
&& flag == SHF_ARM_NOREAD) && flag == SHF_ARM_PURECODE)
*p = 'y'; *p = 'y';
else if (flag & SHF_MASKOS) else if (flag & SHF_MASKOS)
{ {
@ -6118,7 +6118,7 @@ process_section_headers (FILE * file)
|| elf_header.e_machine == EM_K1OM) || elf_header.e_machine == EM_K1OM)
printf (_("l (large), ")); printf (_("l (large), "));
else if (elf_header.e_machine == EM_ARM) else if (elf_header.e_machine == EM_ARM)
printf (_("y (noread), ")); printf (_("y (purecode), "));
printf ("p (processor specific)\n"); printf ("p (processor specific)\n");
} }

View File

@ -1,3 +1,8 @@
2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com>
* include/elf/arm.h (SHF_ARM_NOREAD): Rename to ...
(SHF_ARM_PURECODE): ... this.
2016-07-01 Szabolcs Nagy <szabolcs.nagy@arm.com> 2016-07-01 Szabolcs Nagy <szabolcs.nagy@arm.com>
* opcode/aarch64.h (AARCH64_CPU_HAS_ALL_FEATURES): New. * opcode/aarch64.h (AARCH64_CPU_HAS_ALL_FEATURES): New.

View File

@ -82,7 +82,7 @@
/* ARM-specific values for sh_flags. */ /* ARM-specific values for sh_flags. */
#define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */ #define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */
#define SHF_ARM_NOREAD 0x20000000 /* Section contains code that can be place on no read memory area. */ #define SHF_ARM_PURECODE 0x20000000 /* Section contains only code and no data. */
#define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */ #define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */
/* ARM-specific program header flags. */ /* ARM-specific program header flags. */

View File

@ -1,3 +1,9 @@
2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com>
* testsuite/ld-arm/arm_noread.ld: Renamed to ...
testsuite/ld-arm/arm_purecode.ld: ... this, and replaced
all noread's by purecode.
2016-07-05 Jan Beulich <jbeulich@suse.com> 2016-07-05 Jan Beulich <jbeulich@suse.com>
* ldexp.c (exp_fold_tree_1): Set linker_def field based on * ldexp.c (exp_fold_tree_1): Set linker_def field based on

View File

@ -4,16 +4,16 @@ ENTRY(_start)
MEMORY MEMORY
{ {
read_memory (rx) : ORIGIN = 0x00008000, LENGTH = 4M read_memory (rx) : ORIGIN = 0x00008000, LENGTH = 4M
noread_memory (!rx) : ORIGIN = 0x00800000, LENGTH = 4M purecode_memory (!rx) : ORIGIN = 0x00800000, LENGTH = 4M
} }
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x8000); . = 0x8000; PROVIDE (__executable_start = 0x8000); . = 0x8000;
.text.noread : .text.purecode :
{ {
INPUT_SECTION_FLAGS (SHF_ARM_NOREAD) *(.text*) INPUT_SECTION_FLAGS (SHF_ARM_PURECODE) *(.text*)
} > noread_memory } > purecode_memory
.text : .text :
{ {
*(.before) *(.before)