mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 07:08:01 +08:00
Fix an orphan section problem caused by weird linker scripts.
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
broken list handling. Create __start_SECNAME and __stop_SECNAME
|
broken list handling. Create __start_SECNAME and __stop_SECNAME
|
||||||
when no place-holder. Add some comments. Test both SEC_CODE and
|
when no place-holder. Add some comments. Test both SEC_CODE and
|
||||||
SEC_READONLY for hold_text to prevent .rodata orphan poisoning.
|
SEC_READONLY for hold_text to prevent .rodata orphan poisoning.
|
||||||
|
Handle case where no output section statement created.
|
||||||
|
|
||||||
2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com>
|
2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
|
@ -1203,9 +1203,11 @@ gld${EMULATION_NAME}_place_orphan (file, s)
|
|||||||
}
|
}
|
||||||
place->section = &snew->next; /* Save the end of this list. */
|
place->section = &snew->next; /* Save the end of this list. */
|
||||||
|
|
||||||
|
if (add.head != NULL)
|
||||||
|
{
|
||||||
/* We try to put the output statements in some sort of
|
/* We try to put the output statements in some sort of
|
||||||
reasonable order here, because they determine the final load
|
reasonable order here, because they determine the final
|
||||||
addresses of the orphan sections. */
|
load addresses of the orphan sections. */
|
||||||
if (place->stmt == NULL)
|
if (place->stmt == NULL)
|
||||||
{
|
{
|
||||||
/* Put the new statement list right at the head. */
|
/* Put the new statement list right at the head. */
|
||||||
@ -1219,14 +1221,15 @@ gld${EMULATION_NAME}_place_orphan (file, s)
|
|||||||
*place->stmt = add.head;
|
*place->stmt = add.head;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fix the global list pointer if we happened to tack our new
|
/* Fix the global list pointer if we happened to tack our
|
||||||
list at the tail. */
|
new list at the tail. */
|
||||||
if (*old->tail == add.head)
|
if (*old->tail == add.head)
|
||||||
old->tail = add.tail;
|
old->tail = add.tail;
|
||||||
|
|
||||||
/* Save the end of this list. */
|
/* Save the end of this list. */
|
||||||
place->stmt = add.tail;
|
place->stmt = add.tail;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user