From 90c1602c0f6f430e52d84ec03d321df108301f25 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 19 Jul 2004 19:15:43 +0000 Subject: [PATCH] 2004-07-19 Christopher Faylor H.J. Lu * subsegs.c (section_symbol): Don't create a new segment when existing segment is undefined. --- gas/ChangeLog | 6 ++++++ gas/subsegs.c | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 933e8541502..67257235689 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2004-07-19 Christopher Faylor + H.J. Lu + + * subsegs.c (section_symbol): Don't create a new segment when + existing segment is undefined. + 2004-07-16 Richard Earnshaw * config/tc-arm.c: Include include/opcode/arm.h. diff --git a/gas/subsegs.c b/gas/subsegs.c index 9e46cfe3419..8b0679cbc4c 100644 --- a/gas/subsegs.c +++ b/gas/subsegs.c @@ -523,18 +523,18 @@ section_symbol (segT sec) } else { + segT seg; s = symbol_find_base (sec->symbol->name, 0); /* We have to make sure it is the right symbol when we have multiple sections with the same section name. */ - if (s == NULL || S_GET_SEGMENT (s) != sec) + if (s == NULL + || ((seg = S_GET_SEGMENT (s)) != sec + && seg != undefined_section)) s = symbol_new (sec->symbol->name, sec, 0, &zero_address_frag); - else + else if (seg == undefined_section) { - if (S_GET_SEGMENT (s) == undefined_section) - { - S_SET_SEGMENT (s, sec); - symbol_set_frag (s, &zero_address_frag); - } + S_SET_SEGMENT (s, sec); + symbol_set_frag (s, &zero_address_frag); } } -- 2.30.2