diff options
author | Nick Clifton <nickc@redhat.com> | 2006-05-09 15:13:22 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2006-05-09 15:13:22 +0000 |
commit | 6e0080dd37a13129b04c34c7aa18ec2bee85b731 (patch) | |
tree | c1b52bb3bf791149455f569ff39425da8dab4ef7 /gas | |
parent | 4e2a74a8413a6389d557bf54bc8a4a85004322d5 (diff) | |
download | gdb-6e0080dd37a13129b04c34c7aa18ec2bee85b731.zip gdb-6e0080dd37a13129b04c34c7aa18ec2bee85b731.tar.gz gdb-6e0080dd37a13129b04c34c7aa18ec2bee85b731.tar.bz2 |
Revised test (that is not O(n2)) for checking for orphaned cloned symbols
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-arm.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index fe24ab2..5ccbfc1 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -17016,21 +17016,16 @@ arm_fix_adjustable (fixS * fixP) /* This is a hack for the gas/all/redef2.s test. This test causes symbols to be cloned, and without this test relocs would still be generated - against the original pre-cloned symbol. Such symbols would not appear + against the original, pre-cloned symbol. Such symbols would not appear in the symbol table however, and so a valid reloc could not be generated. So check to see if the fixup is against a symbol which has been removed from the symbol chain, and if it is, then allow it to be adjusted into a reloc against a section symbol. */ - if (fixP->fx_addsy != NULL) - { - symbolS * sym; - - for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym)) - if (sym == fixP->fx_addsy) - break; - if (sym == NULL) - return 1; - } + if (fixP->fx_addsy != NULL + && ! S_IS_LOCAL (fixP->fx_addsy) + && symbol_next (fixP->fx_addsy) == NULL + && symbol_next (fixP->fx_addsy) == symbol_previous (fixP->fx_addsy)) + return 1; return 0; } |