This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: objcopy test failure on mips-linux
>>>>> "Andreas" == Andreas Jaeger <aj@suse.de> writes:
Andreas> The problem is that with objcopy the text.rel section
Andreas> from the original file ends in a text.rela section :-(.
Yes, that's not so good. Logically, though, that doesn't seem a total
disaster, as long the resulting .o still means the same thing as the
first one.
There's a tricky problem here -- because BFD operates abstractly on
some internal notion of relocations, sections, etc., the operating or
reading in a BFD and then writing it back out is not always the
identity transformation, anyhow.
But, I see your point.
Mark> The top-level problem, though, is that on IRIX6 we need both
Mark> REL and RELA relocation sections simultaneously -- as you
Mark> say both N32 and 64-bit objects use both at once. I'm not
Mark> surprised it creates empty sections; as I recall there
Mark> didn't seem any way to know up front whether or not you
Mark> needed the sections.
Andreas> Ok, I understand. Can't we add a check at write out time
Andreas> to only write a e.g. REL section if the RELA section is
Andreas> empty? Currently we write an empty RELA section.
That sounds reasonable, but I think the check is that you should write
the REL section only if the REL section is non-empty, and the RELA
section only if the RELA section is non-empty. Otherwise, with what
you wrote, you might write not write the REL section if both the REL
and RELA sections are non-empty.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com