mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 00:32:30 +08:00
PR ld/12365
* coffgen.c (coff_write_symbol): Assume input section is its own output section if output_section member not set. (coff_write_alien_symbol): Likewise.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2011-05-07 Dave Korn <dave.korn.cygwin@gmail.com>
|
||||||
|
|
||||||
|
PR ld/12365
|
||||||
|
* coffgen.c (coff_write_symbol): Assume input section is its own
|
||||||
|
output section if output_section member not set.
|
||||||
|
(coff_write_alien_symbol): Likewise.
|
||||||
|
|
||||||
2011-05-07 H.J. Lu <hongjiu.lu@intel.com>
|
2011-05-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR ld/12730
|
PR ld/12730
|
||||||
|
@ -915,6 +915,9 @@ coff_write_symbol (bfd *abfd,
|
|||||||
unsigned int numaux = native->u.syment.n_numaux;
|
unsigned int numaux = native->u.syment.n_numaux;
|
||||||
int type = native->u.syment.n_type;
|
int type = native->u.syment.n_type;
|
||||||
int n_sclass = (int) native->u.syment.n_sclass;
|
int n_sclass = (int) native->u.syment.n_sclass;
|
||||||
|
asection *output_section = symbol->section->output_section
|
||||||
|
? symbol->section->output_section
|
||||||
|
: symbol->section;
|
||||||
void * buf;
|
void * buf;
|
||||||
bfd_size_type symesz;
|
bfd_size_type symesz;
|
||||||
|
|
||||||
@ -933,7 +936,7 @@ coff_write_symbol (bfd *abfd,
|
|||||||
|
|
||||||
else
|
else
|
||||||
native->u.syment.n_scnum =
|
native->u.syment.n_scnum =
|
||||||
symbol->section->output_section->target_index;
|
output_section->target_index;
|
||||||
|
|
||||||
coff_fix_symbol_name (abfd, symbol, native, string_size_p,
|
coff_fix_symbol_name (abfd, symbol, native, string_size_p,
|
||||||
debug_string_section_p, debug_string_size_p);
|
debug_string_section_p, debug_string_size_p);
|
||||||
@ -990,6 +993,9 @@ coff_write_alien_symbol (bfd *abfd,
|
|||||||
{
|
{
|
||||||
combined_entry_type *native;
|
combined_entry_type *native;
|
||||||
combined_entry_type dummy;
|
combined_entry_type dummy;
|
||||||
|
asection *output_section = symbol->section->output_section
|
||||||
|
? symbol->section->output_section
|
||||||
|
: symbol->section;
|
||||||
|
|
||||||
native = &dummy;
|
native = &dummy;
|
||||||
native->u.syment.n_type = T_NULL;
|
native->u.syment.n_type = T_NULL;
|
||||||
@ -1015,12 +1021,11 @@ coff_write_alien_symbol (bfd *abfd,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
native->u.syment.n_scnum =
|
native->u.syment.n_scnum = output_section->target_index;
|
||||||
symbol->section->output_section->target_index;
|
|
||||||
native->u.syment.n_value = (symbol->value
|
native->u.syment.n_value = (symbol->value
|
||||||
+ symbol->section->output_offset);
|
+ symbol->section->output_offset);
|
||||||
if (! obj_pe (abfd))
|
if (! obj_pe (abfd))
|
||||||
native->u.syment.n_value += symbol->section->output_section->vma;
|
native->u.syment.n_value += output_section->vma;
|
||||||
|
|
||||||
/* Copy the any flags from the file header into the symbol.
|
/* Copy the any flags from the file header into the symbol.
|
||||||
FIXME: Why? */
|
FIXME: Why? */
|
||||||
|
Reference in New Issue
Block a user