+2007-09-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/3281
+ PR binutils/5037
+ * internal.h (elf_segment_map): Add p_size and p_size_valid.
+ (ELF_IS_SECTION_IN_SEGMENT): Allow SHF_TLS sections in
+ PT_GNU_RELRO segments.
+
2007-09-11 Nathan Sidwell <nathan@codesourcery.com>
* m68k.h (EF_M68K_CF_ISA_C_NODIV): New.
bfd_vma p_vaddr_offset;
/* Program segment alignment. */
bfd_vma p_align;
+ /* Segment size in file and memory */
+ bfd_vma p_size;
/* Whether the p_flags field is valid; if not, the flags are based
on the section flags. */
unsigned int p_flags_valid : 1;
/* Whether the p_align field is valid; if not, PT_LOAD segment
alignment is based on the default maximum page size. */
unsigned int p_align_valid : 1;
+ /* Whether the p_size field is valid; if not, the size are based
+ on the section sizes. */
+ unsigned int p_size_valid : 1;
/* Whether this segment includes the file header. */
unsigned int includes_filehdr : 1;
/* Whether this segment includes the program headers. */
|| segment->p_type == PT_TLS) ? sec_hdr->sh_size : 0)
/* Decide if the given sec_hdr is in the given segment. PT_TLS segment
- contains only SHF_TLS sections. Only PT_LOAD and PT_TLS segments
- can contain SHF_TLS sections. */
+ contains only SHF_TLS sections. Only PT_LOAD, PT_GNU_RELRO and
+ and PT_TLS segments can contain SHF_TLS sections. */
#define ELF_IS_SECTION_IN_SEGMENT(sec_hdr, segment) \
(((((sec_hdr->sh_flags & SHF_TLS) != 0) \
&& (segment->p_type == PT_TLS \
+ || segment->p_type == PT_GNU_RELRO \
|| segment->p_type == PT_LOAD)) \
|| ((sec_hdr->sh_flags & SHF_TLS) == 0 \
&& segment->p_type != PT_TLS)) \