This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Support DF_TEXTREL/DT_TEXTREL for SVR4 mips
- To: Nick Clifton <nickc at cambridge dot redhat dot com>
- Subject: Re: PATCH: Support DF_TEXTREL/DT_TEXTREL for SVR4 mips
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Sat, 16 Jun 2001 02:12:09 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <m3hexghkco.fsf@north-pole.nickc.cambridge.redhat.com>
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.