On 4/7/06, Alan Modra <amodra@xxxxxxxxxxxxxx> wrote: > On Fri, Apr 07, 2006 at 07:09:55PM +0530, Rajat Jain wrote: > > 1) As per my understanding the reason that the (stale) entries for the > > removed sections / symbols are left in the GOT / PLT is because "ld" > > creates the GOT and PLT at an early stage and later when reading the > > linker script discards the sections as requested. It however does not > > see (and does not care) that due to the removal of certain sections, > > the entries in GOT and PLT have become inconsistent. Is my > > understanding correct? > > Yes. > > > 2) Is there any solution to the problem I am facing here? I mean is > > there a way to remove the entries from the GOT and PLT as well? > > I think the basic machinery to do this is already in the linker > --gc-sections support. If I was trying to do this, I would > > o Break out the gc_sweep_hook calls in elflink.c:elf_gc_sweep into > another function. ie. Set SEC_EXCLUDE in elf_gc_sweep, but don't call > the hook to decrement plt/got reloc counts. The new function should > call gc_sweep_hook on all SEC_EXCLUDE sections that have been > processed by check_relocs. > o Arrange to call the new function immediately after > ldlang.c:lang_process calls lang_place_orphans. > Hi Alan, Thanks for the clue. I now have a new direction to look at :) Thanks again, Rajat -- Fedora-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-tools-list