svn commit: r304011 - head/libexec/rtld-elf
Ngie Cooper
yaneurabeya at gmail.com
Fri Aug 12 18:34:45 UTC 2016
> On Aug 12, 2016, at 11:29, Konstantin Belousov <kib at FreeBSD.org> wrote:
>
> Author: kib
> Date: Fri Aug 12 18:29:11 2016
> New Revision: 304011
> URL: https://svnweb.freebsd.org/changeset/base/304011
>
> Log:
> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
Why?
> Sponsored by: The FreeBSD Foundation
> MFC after: 1 week
>
> Modified:
> head/libexec/rtld-elf/rtld.c
>
> Modified: head/libexec/rtld-elf/rtld.c
> ==============================================================================
> --- head/libexec/rtld-elf/rtld.c Fri Aug 12 18:07:44 2016 (r304010)
> +++ head/libexec/rtld-elf/rtld.c Fri Aug 12 18:29:11 2016 (r304011)
> @@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in
> {
> 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
> 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,
> {
> 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 *oldt
> */
> 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;
>
More information about the svn-src-head
mailing list