ld i386 differences 2.10.2 / 2.12

Alan Modra amodra@bigpond.net.au
Tue Mar 26 04:15:00 GMT 2002


On Tue, Mar 26, 2002 at 12:47:08PM +0100, Etienne Lorrain wrote:
>  I do not know exactly why the cross references were not flagged
>  with ld-2.10 / ld-2.11, maybe because it is local symbols referenced
>  only by "mov ...,1f \n ... \n 1:".

Yes, 2.10 and 2.11 cross-reference checking didn't handle section
syms.

>   The thing I was trying to do is more:
> NOCROSSREFS (.extra_text .text);
> NOCROSSREFS (.text_extra .extra);
>   to forbid a function F1 in ".text" to call a stub ".extraF2 -> .textF2"
>  instead of calling directly the ".text" function F2, considering the
>  two function F1 and F2 in the ".text" segment, and the stub in the
>  ".extra_<unprotected>" address space.
>  This cannot work because I need at least one cross-ref per stub, for
>  the stub itself.

Put the stubs in a separate output section.  So sec1 -> stub -> sec2,
and you can use NOCROSSREFS (sec1, sec2)

>  For the ".rel*" sections, because I did not find any option
>  to at least remove the warnings, I added to my linker file:
> SECTIONS {
>         ....
> 	.ld-2.12.bug_please_ignore_warning (NOLOAD) : {
> 		*(.rel*)
> 		}
>         }
>  So it just complains once:
> /home/etienne/projet/toolchain/bin/ld: warning: no memory region specified
> for section `.ld-2.12.bug_please_ignore_warning'
> 
>  Note that it is a strange warning for a "NOLOAD" section.

Indeed.  :-)

I poked around a little to find where the .rel sections are coming from:
They're a result of trying to avoid copy relocs when linking with
dynamic libs.  elf_i386_check_relocs creates the reloc sections during
input bfd processing, before we know whether any dynamic objects are
involved in the link.  I'm going to change this as it's no longer
necessary to create the reloc section since we no longer allocate
space in check_relocs.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list