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: mips64-elf .rel.dyn sections

> A C testcase is generally only of use to people who have the relevant
> target C compilers, but in this case I'll make a guess at the
> problem..

OK.  I worked up a small assembly testcase extracted from my C example that shows the same problem.  Attached.

> This is very unlikely to be the correct solution.  See the comment on
> ref_regular.  Your testcase has a common variable, so I'll guess the
> line should be
>     || (!h->def_regular && !ELF_COMMON_DEF_P (h))

It didn't occur to me to look at the common variable.  Now that you mention it, I see that the .rel.dyn section disappears if I initialize the variable.  Grepping for uses of ELF_COMMON_DEF_P, I see a use in _bfd_elf_dynamic_symbol_p in elflink.c which looks like the problematic code in elfxx-mips.c allocate_dynrelocs.  So, yes, this does look like the right solution.  I tried this on my simple testcase and it works.

I can try this on a full router image build here to see what happens.  This will probably take a day.


Attachment: mips64-elf-rel-dyn-2.txt
Description: mips64-elf-rel-dyn-2.txt

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