2006-06-13 Kevin F. Quinn ld/ * ld.texinfo: document new -z lazy option, inverse of -z now ld/emultempl/ * elf32.em (gld${EMULATION_NAME}_list_options): update help text (gld${EMULATION_NAME}_handle_option): handle new option Index: ld/ld.texinfo =================================================================== RCS file: /cvs/src/src/ld/ld.texinfo,v retrieving revision 1.163 diff -u -r1.163 ld.texinfo --- ld/ld.texinfo 30 May 2006 16:45:31 -0000 1.163 +++ ld/ld.texinfo 13 Jun 2006 18:25:10 -0000 @@ -962,6 +962,12 @@ Marks the object that its symbol table interposes before all symbols but the primary executable. +@item lazy +When generating an executable or shared library, mark it to tell the +dynamic linker to defer function call resolution to the point when +the function is called (lazy binding), rather than at load time. +Lazy binding is the default. + @item loadfltr Marks the object that its filters be processed immediately at runtime. Index: ld/emultempl/elf32.em =================================================================== RCS file: /cvs/src/src/ld/emultempl/elf32.em,v retrieving revision 1.166 diff -u -r1.166 elf32.em --- ld/emultempl/elf32.em 3 Jun 2006 02:45:26 -0000 1.166 +++ ld/emultempl/elf32.em 13 Jun 2006 18:25:11 -0000 @@ -1826,6 +1826,11 @@ link_info.flags |= (bfd_vma) DF_BIND_NOW; link_info.flags_1 |= (bfd_vma) DF_1_NOW; } + else if (strcmp (optarg, "lazy") == 0) + { + link_info.flags &= ~((bfd_vma) DF_BIND_NOW); + link_info.flags_1 &= ~((bfd_vma) DF_1_NOW); + } else if (strcmp (optarg, "origin") == 0) { link_info.flags |= (bfd_vma) DF_ORIGIN; @@ -1909,6 +1914,7 @@ fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n")); fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n")); fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n")); + fprintf (file, _(" -z lazy\t\tMark object lazy runtime binding (default)\n")); fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n")); fprintf (file, _(" -z muldefs\t\tAllow multiple definitions\n")); fprintf (file, _(" -z nocombreloc\tDon't merge dynamic relocs into one section\n"));