diff options
author | Jim Wilson <wilson@tuliptree.org> | 2005-06-08 19:47:59 +0000 |
---|---|---|
committer | Jim Wilson <wilson@tuliptree.org> | 2005-06-08 19:47:59 +0000 |
commit | 4dddc1d199cc4301671b6612fcbcb5372f9d6237 (patch) | |
tree | f57c96160ed9a79a84f1dad709101dfb21fde7e9 | |
parent | 6b5d3a4d35ef634397172c1744e4a26a035a50c2 (diff) | |
download | gdb-4dddc1d199cc4301671b6612fcbcb5372f9d6237.zip gdb-4dddc1d199cc4301671b6612fcbcb5372f9d6237.tar.gz gdb-4dddc1d199cc4301671b6612fcbcb5372f9d6237.tar.bz2 |
Warning and partial fix for gcc -freorder-blocks-and-partition related problem.
PR 994
* config/tc-ia64.c (slot_index): Revert last change. If first_frag
is NULL, then emit a warning, and return the current index.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-ia64.c | 22 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5ea1397..17abc8a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2005-06-08 James E Wilson <wilson@specifixinc.com> + + PR 994 + * config/tc-ia64.c (slot_index): Revert last change. If first_frag + is NULL, then emit a warning, and return the current index. + 2005-06-08 Tomas Hurka <tom@hukatronic.cz> PR991 diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index b6eb6bb..cab32cd 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -2655,7 +2655,7 @@ slot_index (slot_addr, slot_frag, first_addr, first_frag, before_relax) /* If the two addresses are in different frags, then we need to add in the remaining size of this frag, and then the entire size of intermediate frags. */ - while (first_frag != NULL && slot_frag != first_frag) + while (slot_frag != first_frag) { unsigned long start_addr = (unsigned long) &first_frag->fr_literal; @@ -2708,6 +2708,26 @@ slot_index (slot_addr, slot_frag, first_addr, first_frag, before_relax) /* Move to the beginning of the next frag. */ first_frag = first_frag->fr_next; first_addr = (unsigned long) &first_frag->fr_literal; + + /* This can happen if there is section switching in the middle of a + function, causing the frag chain for the function to be broken. */ + if (first_frag == NULL) + { + /* We get six warnings for one problem, because of the loop in + fixup_unw_records, and because fixup_unw_records is called 3 + times: once before creating the variant frag, once to estimate + its size, and once to relax it. This is unreasonable, so we use + a static var to make sure we only emit the warning once. */ + static int warned = 0; + + if (!warned) + { + as_warn ("Corrupted unwind info due to unsupported section switching"); + warned = 1; + } + + return index; + } } /* Add in the used part of the last frag. */ |