The only time the code you quote is executed, this code:
338 else if (len != 0)
339 {
340 /* We cannot use this path element, the value of the
341 replacement is unknown. */
342 check_for_trusted = false;
343 wp = last_elem;
344 break;
345 }
Is when we find a DST we know, say $LIB, but DL_DST_LIB is invalid
e.g. set to -1, indicating that $LIB's value is unknown, in which case
[$ORIGIN/../$LIB] is entirely considered unknown, and*discarded* (which
is what 'wp = last_elem' does).
For v4 I'm going to clean up _dl_dst_substitute to point out that we
only take individual path elements of a multi-path sequence.
I believe this answers your question. Please clarify if I have not.