diff options
author | Jing Yu <jingyu@google.com> | 2012-02-15 15:40:16 -0800 |
---|---|---|
committer | Jing Yu <jingyu@google.com> | 2012-02-15 15:40:16 -0800 |
commit | 3f73d6ef90458b45bbbb33ef4c2b174d4662a22d (patch) | |
tree | 1b5f0d96c51b51168b3713058a1b62e92f1136eb /gcc-4.6/libobjc | |
parent | d7030123e04baab5dbff9c9ee04c0de99bd9a774 (diff) | |
download | toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.gz toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.bz2 toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.zip |
Sync down FSF r184235@google/gcc-4_6_2-mobile branch
1) Get mostly new patches from FSF gcc-4.6 branch
2) Fix PR52129
3) Insert GNU-stack note for all ARM targets
Change-Id: I2b9926981210e517e4021242908074319a91d6bd
Diffstat (limited to 'gcc-4.6/libobjc')
-rw-r--r-- | gcc-4.6/libobjc/ChangeLog | 31 | ||||
-rw-r--r-- | gcc-4.6/libobjc/class.c | 62 | ||||
-rwxr-xr-x | gcc-4.6/libobjc/configure | 6 | ||||
-rw-r--r-- | gcc-4.6/libobjc/init.c | 9 |
4 files changed, 85 insertions, 23 deletions
diff --git a/gcc-4.6/libobjc/ChangeLog b/gcc-4.6/libobjc/ChangeLog index ebbbd46dd..381b97cc0 100644 --- a/gcc-4.6/libobjc/ChangeLog +++ b/gcc-4.6/libobjc/ChangeLog @@ -1,3 +1,34 @@ +2011-11-20 Andreas Tobler <andreast@fgznet.ch> + + * configure: Regenerate. + +2011-10-26 Release Manager + + * GCC 4.6.2 released. + +2011-10-14 Nicola Pero <nicola.pero@meta-innovation.com> + + Backport from mainline + 2011-10-09 Nicola Pero <nicola.pero@meta-innovation.com> + + PR libobjc/49883 + * init.c (__objc_exec_class): Work around a bug in clang's code + generation. Clang sets the class->info field to values different + from 0x1 or 0x2 (the only allowed values in the traditional GNU + Objective-C runtime ABI) to store some additional information, but + this breaks backwards compatibility. Wipe out all the bits in the + fields other than the first two upon loading a class. + +2011-10-14 Nicola Pero <nicola.pero@meta-innovation.com> + + Backport from mainline + 2011-08-06 Nicola Pero <nicola.pero@meta-innovation.com> + + PR libobjc/50002 + * class.c (__objc_update_classes_with_methods): Iterate over meta + classes as well as normal classes when refreshing the method + implementations. This fixes replacing class methods. + 2011-06-27 Release Manager * GCC 4.6.1 released. diff --git a/gcc-4.6/libobjc/class.c b/gcc-4.6/libobjc/class.c index 61d6fdf2f..fb57293a1 100644 --- a/gcc-4.6/libobjc/class.c +++ b/gcc-4.6/libobjc/class.c @@ -850,35 +850,57 @@ __objc_update_classes_with_methods (struct objc_method *method_a, struct objc_me while (node != NULL) { - /* Iterate over all methods in the class. */ - Class class = node->pointer; - struct objc_method_list * method_list = class->methods; - - while (method_list) + /* We execute this loop twice: the first time, we iterate + over all methods in the class (instance methods), while + the second time we iterate over all methods in the meta + class (class methods). */ + Class class = Nil; + BOOL done = NO; + + while (done == NO) { - int i; + struct objc_method_list * method_list; - for (i = 0; i < method_list->method_count; ++i) + if (class == Nil) + { + /* The first time, we work on the class. */ + class = node->pointer; + } + else { - struct objc_method *method = &method_list->method_list[i]; + /* The second time, we work on the meta class. */ + class = class->class_pointer; + done = YES; + } - /* If the method is one of the ones we are looking - for, update the implementation. */ - if (method == method_a) - sarray_at_put_safe (class->dtable, - (sidx) method_a->method_name->sel_id, - method_a->method_imp); + method_list = class->methods; - if (method == method_b) + while (method_list) + { + int i; + + for (i = 0; i < method_list->method_count; ++i) { - if (method_b != NULL) + struct objc_method *method = &method_list->method_list[i]; + + /* If the method is one of the ones we are + looking for, update the implementation. */ + if (method == method_a) sarray_at_put_safe (class->dtable, - (sidx) method_b->method_name->sel_id, - method_b->method_imp); + (sidx) method_a->method_name->sel_id, + method_a->method_imp); + + if (method == method_b) + { + if (method_b != NULL) + sarray_at_put_safe (class->dtable, + (sidx) method_b->method_name->sel_id, + method_b->method_imp); + } } + + method_list = method_list->method_next; } - - method_list = method_list->method_next; } node = node->next; } diff --git a/gcc-4.6/libobjc/configure b/gcc-4.6/libobjc/configure index 0d2393546..045b7d18a 100755 --- a/gcc-4.6/libobjc/configure +++ b/gcc-4.6/libobjc/configure @@ -8812,7 +8812,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9728,7 +9728,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -9746,7 +9746,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) diff --git a/gcc-4.6/libobjc/init.c b/gcc-4.6/libobjc/init.c index d4475b3b7..23ba41ba1 100644 --- a/gcc-4.6/libobjc/init.c +++ b/gcc-4.6/libobjc/init.c @@ -643,6 +643,15 @@ __objc_exec_class (struct objc_module *module) assert (CLS_ISMETA (class->class_pointer)); DEBUG_PRINTF (" installing class '%s'\n", class->name); + /* Workaround for a bug in clang: Clang may set flags other than + _CLS_CLASS and _CLS_META even when compiling for the + traditional ABI (version 8), confusing our runtime. Try to + wipe these flags out. */ + if (CLS_ISCLASS (class)) + __CLS_INFO (class) = _CLS_CLASS; + else + __CLS_INFO (class) = _CLS_META; + /* Initialize the subclass list to be NULL. In some cases it isn't and this crashes the program. */ class->subclass_list = NULL; |