Fix a bug which clobbered linker set symbols that had forward references.
With -O3, egcs generates such forward references. PR: gnu/6055 Reviewed by: jdp Submitted by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru> in slightly different form
This commit is contained in:
parent
216949b446
commit
b317bce843
@ -469,8 +469,24 @@ object_headers *headers;
|
||||
/* JF deal with forward references first... */
|
||||
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
|
||||
if (symbolP->sy_forward && symbolP->sy_forward != symbolP) {
|
||||
switch (S_GET_TYPE(symbolP)) {
|
||||
|
||||
case N_SETA:
|
||||
case N_SETT:
|
||||
case N_SETD:
|
||||
case N_SETB:
|
||||
/*
|
||||
* Don't change the segments of SET symbols,
|
||||
* because that would turn them into regular
|
||||
* symbols.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
S_SET_SEGMENT(symbolP,
|
||||
S_GET_SEGMENT(symbolP->sy_forward));
|
||||
break;
|
||||
}
|
||||
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP)
|
||||
+ S_GET_VALUE(symbolP->sy_forward)
|
||||
+ symbolP->sy_forward->sy_frag->fr_address);
|
||||
|
Loading…
Reference in New Issue
Block a user