Hello everyone, Here is something that implements a compromise between the previous behavior, and the new behavior in terms of objfile search order. The gist of the patch is that it introduces an iterator that can take a "context" objfile into account for the iteration order. The rest are small adjustements to use the iterator. Long term, I think we are opening the door for more arch-dependency by adjusting the body of the iterator. I'll leave that part to someone else who's motivated (I think it's a can of worms). This patch assumes that my other patch has been reverted. This way, it allows us to start from the initial code, and see how I am changing it this time. It also includes a C testcase, which hopefully reproduces the same issue as gdb.fortran/library-module.exp, but in C, to widen the number of people testing this feature. For now, it's only a prototype, so I'm seeking comments. I will document the code when we're happy with the approach. Tested on x86_64-linux, no regression. Fixes the new testcase. Thanks, -- Joel