This is the mail archive of the binutils@sources.redhat.com 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]

Re: PATCH: Support DF_TEXTREL/DT_TEXTREL for SVR4 mips


On Sat, Jun 16, 2001 at 09:58:31AM +0100, Nick Clifton wrote:
> Hi H.J.
> 
> +               {
> +                 /* When creating a shared object, we must copy these
> +                    reloc types into the output file as R_MIPS_REL32
> +                    relocs.  We make room for this reloc in the
> +                    .rel.dyn reloc section.  */
> +                 mips_elf_allocate_dynamic_relocations (dynobj, 1);
> +                 if ((sec->flags & SEC_READONLY) != 0)
> +                   /* We tell the dynamic linker that there are
> +                      relocations against the text segment.  */
> +                   info->flags |= DF_TEXTREL;
> +               }
> 
> Is it safe to just check SEC_READONLY ?  Shouldn't you also check for
> SEC_CODE ?

I don't think it is necessary. We have allocated an entry in .rel.dyn
for it and we know it is against a readonly section is readonly. What
else do do we need to check? Besides, the problem I ran into is the
rodata section.  The asm code looks like

	.rodata
foo:
	.long	bar

The linker puts rodata sections in the text segment.


H.J.


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