mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
*** empty log message ***
This commit is contained in:
@ -1249,7 +1249,7 @@ swap_std_reloc_out (abfd, g, natptr)
|
|||||||
|
|
||||||
bfd_h_putlong (abfd, g->address, natptr->r_address);
|
bfd_h_putlong (abfd, g->address, natptr->r_address);
|
||||||
|
|
||||||
r_length = g->howto->size; /* Size as a power of two */
|
r_length = g->howto->size ; /* Size as a power of two */
|
||||||
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
|
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
|
||||||
/* r_baserel, r_jmptable, r_relative??? FIXME-soon */
|
/* r_baserel, r_jmptable, r_relative??? FIXME-soon */
|
||||||
r_baserel = 0;
|
r_baserel = 0;
|
||||||
@ -1633,14 +1633,14 @@ sunos4_squirt_out_relocs (abfd, section)
|
|||||||
for (natptr = native;
|
for (natptr = native;
|
||||||
count != 0;
|
count != 0;
|
||||||
--count, natptr += each_size, ++generic)
|
--count, natptr += each_size, ++generic)
|
||||||
swap_ext_reloc_out (abfd, generic, (struct reloc_ext_bytes *)native);
|
swap_ext_reloc_out (abfd, *generic, (struct reloc_ext_bytes *)natptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (natptr = native;
|
for (natptr = native;
|
||||||
count != 0;
|
count != 0;
|
||||||
--count, natptr += each_size, ++generic)
|
--count, natptr += each_size, ++generic)
|
||||||
swap_std_reloc_out(abfd, generic, (struct reloc_std_bytes *)native);
|
swap_std_reloc_out(abfd, *generic, (struct reloc_std_bytes *)natptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
|
if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
|
||||||
|
@ -1249,7 +1249,7 @@ swap_std_reloc_out (abfd, g, natptr)
|
|||||||
|
|
||||||
bfd_h_putlong (abfd, g->address, natptr->r_address);
|
bfd_h_putlong (abfd, g->address, natptr->r_address);
|
||||||
|
|
||||||
r_length = g->howto->size; /* Size as a power of two */
|
r_length = g->howto->size ; /* Size as a power of two */
|
||||||
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
|
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
|
||||||
/* r_baserel, r_jmptable, r_relative??? FIXME-soon */
|
/* r_baserel, r_jmptable, r_relative??? FIXME-soon */
|
||||||
r_baserel = 0;
|
r_baserel = 0;
|
||||||
@ -1633,14 +1633,14 @@ sunos4_squirt_out_relocs (abfd, section)
|
|||||||
for (natptr = native;
|
for (natptr = native;
|
||||||
count != 0;
|
count != 0;
|
||||||
--count, natptr += each_size, ++generic)
|
--count, natptr += each_size, ++generic)
|
||||||
swap_ext_reloc_out (abfd, generic, (struct reloc_ext_bytes *)native);
|
swap_ext_reloc_out (abfd, *generic, (struct reloc_ext_bytes *)natptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (natptr = native;
|
for (natptr = native;
|
||||||
count != 0;
|
count != 0;
|
||||||
--count, natptr += each_size, ++generic)
|
--count, natptr += each_size, ++generic)
|
||||||
swap_std_reloc_out(abfd, generic, (struct reloc_std_bytes *)native);
|
swap_std_reloc_out(abfd, *generic, (struct reloc_std_bytes *)natptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
|
if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
|
||||||
|
2
ld/ld.h
2
ld/ld.h
@ -85,7 +85,7 @@ typedef struct
|
|||||||
This is used mainly to finish of sets that were built. */
|
This is used mainly to finish of sets that were built. */
|
||||||
boolean unix_relocate;
|
boolean unix_relocate;
|
||||||
|
|
||||||
|
boolean sort_common;
|
||||||
} ld_config_type;
|
} ld_config_type;
|
||||||
#define set_asymbol_chain(x,y) ((x)->udata = (PTR)y)
|
#define set_asymbol_chain(x,y) ((x)->udata = (PTR)y)
|
||||||
#define get_asymbol_chain(x) ((asymbol **)((x)->udata))
|
#define get_asymbol_chain(x) ((asymbol **)((x)->udata))
|
||||||
|
@ -117,7 +117,7 @@ boolean ldgram_had_equals = false;
|
|||||||
%token MEMORY
|
%token MEMORY
|
||||||
%token DSECT NOLOAD COPY INFO OVERLAY
|
%token DSECT NOLOAD COPY INFO OVERLAY
|
||||||
%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
||||||
%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S
|
%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common
|
||||||
%token OPTION_format OPTION_F OPTION_u
|
%token OPTION_format OPTION_F OPTION_u
|
||||||
|
|
||||||
%token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
|
%token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
|
||||||
@ -209,6 +209,9 @@ command_line_option:
|
|||||||
{
|
{
|
||||||
force_make_executable = true;
|
force_make_executable = true;
|
||||||
}
|
}
|
||||||
|
| OPTION_sort_common {
|
||||||
|
config.sort_common = true;
|
||||||
|
}
|
||||||
| OPTION_d {
|
| OPTION_d {
|
||||||
command_line.force_common_definition = true;
|
command_line.force_common_definition = true;
|
||||||
}
|
}
|
||||||
|
20
ld/ldlang.c
20
ld/ldlang.c
@ -1660,14 +1660,19 @@ DEFUN_VOID(lang_check)
|
|||||||
/*
|
/*
|
||||||
* run through all the global common symbols and tie them
|
* run through all the global common symbols and tie them
|
||||||
* to the output section requested.
|
* to the output section requested.
|
||||||
|
*
|
||||||
|
As an experiment we do this 4 times, once for all the byte sizes,
|
||||||
|
then all the two bytes, all the four bytes and then everything else
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DEFUN_VOID(lang_common)
|
DEFUN_VOID(lang_common)
|
||||||
{
|
{
|
||||||
ldsym_type *lgs;
|
ldsym_type *lgs;
|
||||||
|
size_t power;
|
||||||
if (config.relocateable_output == false ||
|
if (config.relocateable_output == false ||
|
||||||
command_line.force_common_definition== true) {
|
command_line.force_common_definition== true) {
|
||||||
|
for (power = 1; (config.sort_common == true && power == 1) || (power <= 16); power <<=1) {
|
||||||
for (lgs = symbol_head;
|
for (lgs = symbol_head;
|
||||||
lgs != (ldsym_type *)NULL;
|
lgs != (ldsym_type *)NULL;
|
||||||
lgs=lgs->next)
|
lgs=lgs->next)
|
||||||
@ -1706,8 +1711,7 @@ DEFUN_VOID(lang_common)
|
|||||||
align = 16;
|
align = 16;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (config.sort_common == false || align == power) {
|
||||||
|
|
||||||
/* Change from a common symbol into a definition of
|
/* Change from a common symbol into a definition of
|
||||||
a symbol */
|
a symbol */
|
||||||
lgs->sdefs_chain = lgs->scoms_chain;
|
lgs->sdefs_chain = lgs->scoms_chain;
|
||||||
@ -1729,18 +1733,21 @@ DEFUN_VOID(lang_common)
|
|||||||
we remember that it was common once. */
|
we remember that it was common once. */
|
||||||
|
|
||||||
com->flags = BSF_EXPORT | BSF_GLOBAL | BSF_OLD_COMMON;
|
com->flags = BSF_EXPORT | BSF_GLOBAL | BSF_OLD_COMMON;
|
||||||
|
com->value = com->section->size;
|
||||||
|
|
||||||
if (write_map)
|
if (write_map)
|
||||||
{
|
{
|
||||||
printf ("Allocating common %s: %x at %x\n",
|
printf ("Allocating common %s: %x at %x %s\n",
|
||||||
lgs->name,
|
lgs->name,
|
||||||
(unsigned) size,
|
(unsigned) size,
|
||||||
(unsigned) com->section->size);
|
(unsigned) com->value,
|
||||||
|
com->the_bfd->filename);
|
||||||
}
|
}
|
||||||
com->value = com->section->size;
|
|
||||||
com->section->size += size;
|
com->section->size += size;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1829,6 +1836,7 @@ DEFUN(lang_set_flags,(ptr, flags),
|
|||||||
ptr->flag_executable= state;
|
ptr->flag_executable= state;
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
|
case 'I':
|
||||||
ptr->flag_loadable= state;
|
ptr->flag_loadable= state;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -274,7 +274,7 @@ PROTO(void,lang_set_flags,(lang_section_flags_type *, CONST char *));
|
|||||||
PROTO(void,lang_add_output,(CONST char *));
|
PROTO(void,lang_add_output,(CONST char *));
|
||||||
|
|
||||||
PROTO(void,lang_final,(void));
|
PROTO(void,lang_final,(void));
|
||||||
PROTO(struct symbol_cache_entry *,create_symbol,(CONST char *, unsigned int, struct sec_struct *));
|
PROTO(struct symbol_cache_entry *,create_symbol,(CONST char *, unsigned int, struct sec *));
|
||||||
PROTO(void ,lang_process,(void));
|
PROTO(void ,lang_process,(void));
|
||||||
PROTO(void ,lang_section_start,(CONST char *, union etree_union *));
|
PROTO(void ,lang_section_start,(CONST char *, union etree_union *));
|
||||||
PROTO(void,lang_add_entry,(CONST char *));
|
PROTO(void,lang_add_entry,(CONST char *));
|
||||||
|
@ -275,6 +275,7 @@ WHITE [ \t]+
|
|||||||
"@" { return '}'; }
|
"@" { return '}'; }
|
||||||
"\ -defsym\ " { ldgram_in_defsym = true; return OPTION_defsym; }
|
"\ -defsym\ " { ldgram_in_defsym = true; return OPTION_defsym; }
|
||||||
"\ -noinhibit_exec\ " { return OPTION_noinhibit_exec; }
|
"\ -noinhibit_exec\ " { return OPTION_noinhibit_exec; }
|
||||||
|
"\ -sort_common\ " { return OPTION_sort_common;}
|
||||||
"\ -format\ " { return OPTION_format; }
|
"\ -format\ " { return OPTION_format; }
|
||||||
"\ -n\ " { return OPTION_n; }
|
"\ -n\ " { return OPTION_n; }
|
||||||
"\ -r\ " { return OPTION_r; }
|
"\ -r\ " { return OPTION_r; }
|
||||||
|
@ -51,7 +51,7 @@ char *output_filename = "a.out";
|
|||||||
char *program_name;
|
char *program_name;
|
||||||
|
|
||||||
/* The file that we're creating */
|
/* The file that we're creating */
|
||||||
bfd *output_bfd;
|
bfd *output_bfd = 0;
|
||||||
|
|
||||||
extern boolean option_v;
|
extern boolean option_v;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user