mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
When choosing the target for a particular endianness, do nothing if the target
is not supported.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2000-08-25 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* ldlang.c (open_output): When choosing the target for a
|
||||||
|
particular endianness, do nothing if the target is not
|
||||||
|
supported.
|
||||||
|
|
||||||
2000-08-25 H.J. Lu <hjl@gnu.org>
|
2000-08-25 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
|
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
|
||||||
|
55
ld/ldlang.c
55
ld/ldlang.c
@ -1728,32 +1728,37 @@ open_output (name)
|
|||||||
/* Get the chosen target. */
|
/* Get the chosen target. */
|
||||||
target = bfd_search_for_target (get_target, (void *) output_target);
|
target = bfd_search_for_target (get_target, (void *) output_target);
|
||||||
|
|
||||||
if (command_line.endian == ENDIAN_BIG)
|
/* If the target is not supported, we cannot do anything. */
|
||||||
desired_endian = BFD_ENDIAN_BIG;
|
if (target != NULL)
|
||||||
else
|
|
||||||
desired_endian = BFD_ENDIAN_LITTLE;
|
|
||||||
|
|
||||||
/* See if the target has the wrong endianness. This should not happen
|
|
||||||
if the linker script has provided big and little endian alternatives,
|
|
||||||
but some scrips don't do this. */
|
|
||||||
if (target->byteorder != desired_endian)
|
|
||||||
{
|
{
|
||||||
/* If it does, then see if the target provides
|
if (command_line.endian == ENDIAN_BIG)
|
||||||
an alternative with the correct endianness. */
|
desired_endian = BFD_ENDIAN_BIG;
|
||||||
if (target->alternative_target != NULL
|
|
||||||
&& (target->alternative_target->byteorder == desired_endian))
|
|
||||||
output_target = target->alternative_target->name;
|
|
||||||
else
|
else
|
||||||
|
desired_endian = BFD_ENDIAN_LITTLE;
|
||||||
|
|
||||||
|
/* See if the target has the wrong endianness. This should not happen
|
||||||
|
if the linker script has provided big and little endian alternatives,
|
||||||
|
but some scrips don't do this. */
|
||||||
|
if (target->byteorder != desired_endian)
|
||||||
{
|
{
|
||||||
/* Try to find a target as similar as possible to the default
|
/* If it does, then see if the target provides
|
||||||
target, but which has the desired endian characteristic. */
|
an alternative with the correct endianness. */
|
||||||
(void) bfd_search_for_target (closest_target_match, (void *) target);
|
if (target->alternative_target != NULL
|
||||||
|
&& (target->alternative_target->byteorder == desired_endian))
|
||||||
/* Oh dear - we could not find any targets that satisfy our requirements. */
|
output_target = target->alternative_target->name;
|
||||||
if (winner == NULL)
|
|
||||||
einfo (_("%P: warning: could not find any targets that match endianness requirement\n"));
|
|
||||||
else
|
else
|
||||||
output_target = winner->name;
|
{
|
||||||
|
/* Try to find a target as similar as possible to the default
|
||||||
|
target, but which has the desired endian characteristic. */
|
||||||
|
(void) bfd_search_for_target (closest_target_match, (void *) target);
|
||||||
|
|
||||||
|
/* Oh dear - we could not find any targets that satisfy our
|
||||||
|
requirements. */
|
||||||
|
if (winner == NULL)
|
||||||
|
einfo (_("%P: warning: could not find any targets that match endianness requirement\n"));
|
||||||
|
else
|
||||||
|
output_target = winner->name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3155,14 +3160,15 @@ lang_do_assignments (s, output_section_statement, fill, dot)
|
|||||||
dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb;
|
dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (os->load_base)
|
if (os->load_base)
|
||||||
{
|
{
|
||||||
/* If nothing has been placed into the output section then
|
/* If nothing has been placed into the output section then
|
||||||
it won't have a bfd_section. */
|
it won't have a bfd_section. */
|
||||||
if (os->bfd_section)
|
if (os->bfd_section)
|
||||||
{
|
{
|
||||||
os->bfd_section->lma
|
os->bfd_section->lma
|
||||||
= exp_get_abs_int(os->load_base, 0,"load base", lang_final_phase_enum);
|
= exp_get_abs_int(os->load_base, 0,"load base",
|
||||||
|
lang_final_phase_enum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3873,7 +3879,6 @@ lang_enter_output_section_statement (output_section_statement_name,
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
lang_final ()
|
lang_final ()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user