It mostly ends up in landfill. At some point we may be resource poor, and but energy rich and we'll use Plasma mass separation to separate each element out and reuse the valuable ones. Until then it's safely stored there.
No doubt most valuable elements do end up in landfill and most will ultimately be recovered, but we still need to have a good handle of what's actually lost or doesn't make it there, and or how much leaches out before recovery. (Here we don't seem to have decent figures, if anyone knows of any authoritative references please post them.)
Hopefully, as you suggest, we will eventually be energy rich and can afford mass separation techniques to recover these elements. Nevertheless, unless some very cleaver as yet uninvented techniques are used then the amount of energy involved would likely be enormous (but I'm almost certain such techniques will be available in the foreseeable future).
Incidentally, for the same reason, I'm not overly worried about the necessity for having inordinately long-term storage for nuclear waste (hundreds of thousands of years), as in an energy-rich world there'd be enough energy to enable the use of transmutation techniques (along with fast breeders, etc.) to ensure these dangerous byproducts are 'burnt' to harmless materials. Basically, whilst nuclear waste is a big problem it's a comparatively short-term one.
That said, we're doing a pretty poor job of repurifying recycled materials now and the reasons are multifold. I'll give an example I've come across but there are hundreds more. Batteries of any kind should never be thrown away because of the valuable materials they contain. To my knowledge, with the exception of lead-acid batteries, an unknown amount of used battery material is recycled annually, but the effectiveness of what is actually recycled is limited due (it seems†) to the difficulty of repurifying said materials.
For example, recycled reagents and other components, depolarizers such as manganese dioxide, are (often?) insufficiently pure to ensure a battery's long-term storage life. Instead of say an alkaline cell having a nominal storage life of about six years, impure components contain unwanted ionic/conductive materials that lead to a much increased self-discharge rate that shortens shelf life (I've seen such cells become discharged in only about one third the time of those with well-purified materials).
No doubt higher levels of purification would be achieved if more energy were inputted into re-refining these materials. That said, this re-refining problem isn't just limited to batteries but is intrinsic to many recycling processes. Probably the best known and most problematic is that of separating used plastics together with their cracking/depolymerization. Again, it's almost certain these problems would be eliminated if enough cheap energy were available.
__
† Obviously, repurifying recycled materials is different to their original refining from ores etc. as repurifying processes would be required to remove unwanted materials that were never present in the original refining process. I am unclear about what this involves and or the extent of its deployment as there seems precious little information about it in the public domain.