View | Details | Raw Unified | Return to bug 21000 | Differences between
and this patch

Collapse All | Expand All

(-)a/bfd/elf-bfd.h (+4 lines)
Lines 1461-1466 struct elf_backend_data Link Here
1461
     This field indicates whether this behavior is required.  */
1461
     This field indicates whether this behavior is required.  */
1462
  unsigned want_p_paddr_set_to_zero : 1;
1462
  unsigned want_p_paddr_set_to_zero : 1;
1463
1463
1464
  /* Target has broken hardware and/or kernel that requires pages not
1465
     to be mapped twice with different permissions.  */
1466
  unsigned no_page_alias : 1;
1467
1464
  /* True if an object file lacking a .note.GNU-stack section
1468
  /* True if an object file lacking a .note.GNU-stack section
1465
     should be assumed to be requesting exec stack.  At least one
1469
     should be assumed to be requesting exec stack.  At least one
1466
     other file in the link needs to have a .note.GNU-stack section
1470
     other file in the link needs to have a .note.GNU-stack section
(-)a/bfd/elf.c (+11 lines)
Lines 5125-5130 assign_file_positions_for_load_sections (bfd *abfd, Link Here
5125
  Elf_Internal_Phdr *p;
5125
  Elf_Internal_Phdr *p;
5126
  file_ptr off;
5126
  file_ptr off;
5127
  bfd_size_type maxpagesize;
5127
  bfd_size_type maxpagesize;
5128
  unsigned int pt_load_count = 0;
5128
  unsigned int alloc;
5129
  unsigned int alloc;
5129
  unsigned int i, j;
5130
  unsigned int i, j;
5130
  bfd_vma header_pad = 0;
5131
  bfd_vma header_pad = 0;
Lines 5252-5257 assign_file_positions_for_load_sections (bfd *abfd, Link Here
5252
	    maxpagesize = m->p_align;
5253
	    maxpagesize = m->p_align;
5253
5254
5254
	  p->p_align = maxpagesize;
5255
	  p->p_align = maxpagesize;
5256
	  pt_load_count += 1;
5255
	}
5257
	}
5256
      else if (m->p_align_valid)
5258
      else if (m->p_align_valid)
5257
	p->p_align = m->p_align;
5259
	p->p_align = m->p_align;
Lines 5303-5308 assign_file_positions_for_load_sections (bfd *abfd, Link Here
5303
	      }
5305
	      }
5304
5306
5305
	  off_adjust = vma_page_aligned_bias (p->p_vaddr, off, align);
5307
	  off_adjust = vma_page_aligned_bias (p->p_vaddr, off, align);
5308
5309
	  /* Broken hardware and/or kernel require that files do not
5310
	     map the same page with different permissions on some hppa
5311
	     processors.  */
5312
	  if (pt_load_count > 1
5313
	      && bed->no_page_alias
5314
	      && (off & (maxpagesize - 1)) != 0
5315
	      && (off & -maxpagesize) == ((off + off_adjust) & -maxpagesize))
5316
	    off_adjust += maxpagesize;
5306
	  off += off_adjust;
5317
	  off += off_adjust;
5307
	  if (no_contents)
5318
	  if (no_contents)
5308
	    {
5319
	    {
(-)a/bfd/elf32-hppa.c (+1 lines)
Lines 4644-4649 elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) Link Here
4644
#define elf_backend_want_dynrelro	     1
4644
#define elf_backend_want_dynrelro	     1
4645
#define elf_backend_rela_normal		     1
4645
#define elf_backend_rela_normal		     1
4646
#define elf_backend_dtrel_excludes_plt	     1
4646
#define elf_backend_dtrel_excludes_plt	     1
4647
#define elf_backend_no_page_alias	     1
4647
4648
4648
#define TARGET_BIG_SYM		hppa_elf32_vec
4649
#define TARGET_BIG_SYM		hppa_elf32_vec
4649
#define TARGET_BIG_NAME		"elf32-hppa"
4650
#define TARGET_BIG_NAME		"elf32-hppa"
(-)a/bfd/elfxx-target.h (+4 lines)
Lines 114-119 Link Here
114
#ifndef elf_backend_want_p_paddr_set_to_zero
114
#ifndef elf_backend_want_p_paddr_set_to_zero
115
#define elf_backend_want_p_paddr_set_to_zero 0
115
#define elf_backend_want_p_paddr_set_to_zero 0
116
#endif
116
#endif
117
#ifndef elf_backend_no_page_alias
118
#define elf_backend_no_page_alias 0
119
#endif
117
#ifndef elf_backend_default_execstack
120
#ifndef elf_backend_default_execstack
118
#define elf_backend_default_execstack 1
121
#define elf_backend_default_execstack 1
119
#endif
122
#endif
Lines 860-865 static struct elf_backend_data elfNN_bed = Link Here
860
  elf_backend_want_dynbss,
863
  elf_backend_want_dynbss,
861
  elf_backend_want_dynrelro,
864
  elf_backend_want_dynrelro,
862
  elf_backend_want_p_paddr_set_to_zero,
865
  elf_backend_want_p_paddr_set_to_zero,
866
  elf_backend_no_page_alias,
863
  elf_backend_default_execstack,
867
  elf_backend_default_execstack,
864
  elf_backend_caches_rawsize,
868
  elf_backend_caches_rawsize,
865
  elf_backend_extern_protected_data
869
  elf_backend_extern_protected_data
(-)a/ld/testsuite/ld-elf/loadaddr1.d (-1 / +1 lines)
Lines 6-10 Link Here
6
#...
6
#...
7
  LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
7
  LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
8
  LOAD +0x200000 0xf*ff600000 0xf*80101000 0x0*10 0x0*10 R E 0x200000
8
  LOAD +0x200000 0xf*ff600000 0xf*80101000 0x0*10 0x0*10 R E 0x200000
9
  LOAD +0x302000 0xf*80102000 0xf*80102000 0x0*10 0x0*10 RW  0x200000
9
  LOAD +0x[35]02000 0xf*80102000 0xf*80102000 0x0*10 0x0*10 RW  0x200000
10
#pass
10
#pass
(-)a/ld/testsuite/ld-elf/loadaddr2.d (-2 / +2 lines)
Lines 5-10 Link Here
5
5
6
#...
6
#...
7
  LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
7
  LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
8
  LOAD +0x110000 0xf*80110000 0xf*80101000 0x0*10 0x0*10 R E 0x200000
8
  LOAD +0x[13]10000 0xf*80110000 0xf*80101000 0x0*10 0x0*10 R E 0x200000
9
  LOAD +0x302000 0xf*80302000 0xf*80302000 0x0*10 0x0*10 RW  0x200000
9
  LOAD +0x[35]02000 0xf*80302000 0xf*80302000 0x0*10 0x0*10 RW  0x200000
10
#pass
10
#pass
(-)a/ld/testsuite/ld-elf/loadaddr3a.d (-1 / +1 lines)
Lines 5-9 Link Here
5
5
6
#...
6
#...
7
  LOAD +0x000000 0x0*00000000 0x0*00000000 0x0*0110 0x0*0110 R E 0x.*
7
  LOAD +0x000000 0x0*00000000 0x0*00000000 0x0*0110 0x0*0110 R E 0x.*
8
  LOAD +0x000200 0x0*00000200 0x0*00000110 0x0*0010 0x0*0010 RW  0x.*
8
  LOAD +0x[02]00200 0x0*00000200 0x0*00000110 0x0*0010 0x0*0010 RW  0x.*
9
#pass
9
#pass
(-)a/ld/testsuite/ld-scripts/rgn-at5.d (-4 / +4 lines)
Lines 13-20 Sections: Link Here
13
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
13
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
14
  0 .sec0 +0+4 +0+2000 +0+2000 +0+1000 +.*
14
  0 .sec0 +0+4 +0+2000 +0+2000 +0+1000 +.*
15
  1 .sec1 +0+4 +0+1000 +0+2004 +0+2000 +.*
15
  1 .sec1 +0+4 +0+1000 +0+2004 +0+2000 +.*
16
  2 .sec2 +0+4 +0+4000 +0+603c +0+4000 +.*
16
  2 .sec2 +0+4 +0+4000 +0+603c +0+[45]000 +.*
17
  3 .sec3 +0+4 +0+5000 +0+5000 +0+3000 +.*
17
  3 .sec3 +0+4 +0+5000 +0+5000 +0+[34]000 +.*
18
  4 .sec4 +0+4 +0+2008 +0+2008 +0+2008 +.*
18
  4 .sec4 +0+4 +0+2008 +0+2008 +0+[23]008 +.*
19
  5 .sec5 +0+4 +0+200c +0+200c +0+200c +.*
19
  5 .sec5 +0+4 +0+200c +0+200c +0+[23]00c +.*
20
#pass
20
#pass

Return to bug 21000