This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MIPS] Why is PT_DYNAMIC marked as PF_W (write)?

Jack Carter <> writes:
> Traditionally the .dynamic section/segment resides in the text
> segment, but wherever it gets located the flags are hardcoded as
> below:
>       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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]