This is the mail archive of the
mailing list for the binutils project.
Re: [MIPS] Why is PT_DYNAMIC marked as PF_W (write)?
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jack Carter <Jack dot Carter at imgtec dot com>
- Cc: "binutils\ at sourceware dot org" <binutils at sourceware dot org>, Chris Dearman <Chris dot Dearman at imgtec dot com>
- Date: Thu, 13 Feb 2014 09:41:55 +0000
- Subject: Re: [MIPS] Why is PT_DYNAMIC marked as PF_W (write)?
- Authentication-results: sourceware.org; auth=none
- References: <4CEFBC1BE64A8048869F799EF2D2EEEE4C6F3F90 at BADAG02 dot ba dot imgtec dot org>
Jack Carter <Jack.Carter@imgtec.com> writes:
> Traditionally the .dynamic section/segment resides in the text
> segment, but wherever it gets located the flags are hardcoded as
> if (m != NULL && IRIX_COMPAT (abfd) == ict_none)
> /* For a normal mips executable the permissions for the PT_DYNAMIC
> segment are read, write and execute. We do that here since
> the code in elf.c sets only the read permission. This matters
> sometimes for the dynamic linker. */
> if (bfd_get_section_by_name (abfd, ".dynamic") != NULL)
> m->p_flags = PF_R | PF_W | PF_X;
> m->p_flags_valid = 1;
This code comes from f7cb7d68c22ad9334ead499c25008d107906b891.
I don't know why it was added either but:
suggests it might have been for mips-dde-sysv4.2MP.
> If this is obsolete for Mips, can I fix it to match the PT_LOAD
> segment it overlays? ;-) The "This matters sometimes for the dynamic
> linker" is probably part of the answer, but I haven't found it yet.
Yeah, I think we can drop the code you quoted.