Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2016-08-12 18:29:11 +00:00
parent 563e703714
commit 20ee0f7112

View File

@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, int flags)
{
Obj_Entry *obj;
obj = first;
TAILQ_FOREACH_FROM(obj, &obj_list, next) {
for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
if (process_needed(obj, obj->needed, flags) == -1)
@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool bind_now, Obj_Entry *rtldobj,
Obj_Entry *obj;
int error;
error = 0;
obj = first;
TAILQ_FOREACH_FROM(obj, &obj_list, next) {
for (error = 0, obj = first; obj != NULL;
obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
error = relocate_object(obj, bind_now, rtldobj, flags,
@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags,
{
Obj_Entry *obj;
obj = first;
TAILQ_FOREACH_FROM(obj, &obj_list, next) {
for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1)
@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj)
list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL"));
TAILQ_FOREACH_FROM(obj, &obj_list, next) {
for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
Needed_Entry *needed;
char *name, *path;
bool is_lib;
@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign)
*/
free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
} else {
obj = objs;
TAILQ_FOREACH_FROM(obj, &obj_list, next) {
for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker || obj->tlsoffset == 0)
continue;
addr = segbase - obj->tlsoffset;