sorry that this isnt very technical, i just spent 3 days breaking/deleting things, but this seems to be a bug in portages sorting order. when it sorts files, it does it from reverse, and i have two libc files in /lib, libc-2.3.6.so (the good one) and libc.2.3.3 (the bad one). libc.2.3.3 hads a odd dot between libc and the version number, and no one wants to claim the file (equery turns up a blank), so im assuming its bastaerdized, and probably a old type form glibc-2.3.3. but this file was never unmerged, so apparently its been sitting here for a while. when portage is cleaning up, it calls env-update, which seems to go through thte symlinks, and when it gets to /lib/libc.so.6, it finds a 'newer' version of libc, or atleast one that comes first if its reverse sorted. this then really screws up the system untill the file is deleted. not sure how this would be fixed, or if its even valid anymore. i also dont know how many packages would be broken if it sorted by filename- so typoed files like that dont get sorted? have fun.
what does `readelf -d libc.2.3.3` show
root@gentoo:: readelf -d libc.2.3.3.so [~] Dynamic section at offset 0x10bf5c contains 24 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [ld-linux.so.2] 0x0000000e (SONAME) Library soname: [libc.so.6] 0x0000000c (INIT) 0x15750 0x0000001a (FINI_ARRAY) 0x10a71c 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x00000004 (HASH) 0x174 0x00000005 (STRTAB) 0xbfc4 0x00000006 (SYMTAB) 0x3454 0x0000000a (STRSZ) 21213 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x10d0a8 0x00000002 (PLTRELSZ) 232 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x153f0 0x00000011 (REL) 0x126c0 0x00000012 (RELSZ) 11568 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffc (VERDEF) 0x12410 0x6ffffffd (VERDEFNUM) 18 0x6ffffffe (VERNEED) 0x12680 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x112a2 0x6ffffffa (RELCOUNT) 1347 0x00000000 (NULL) 0x0
i really havent the foggiest where libc.2.3.3 came from, but the changing of the links has nothing to do with portage the tool that does it is called 'ldconfig' and it comes with glibc
probably came form glibc-2.3.3, but i dont know how it got there, unless glibc people had a typo? but portage broke the symlinks on emerges, ldconfigs, env-updates, and gcc-config
this is by design if more than 1 file provides the same SONAME, then ldconfig performs an ASCII comparison on the names to decides who wins in ASCII, the dash ('-') comes before the dot ('.'), so any file named 'libc.' will win over any file named 'libc-' in your case, you have libc-2.3.6.so and libc.2.3.3 and so libc.2.3.3 won