mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
* elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
argument. If it is not NULL, use it to set DT_RPATH. * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. (bfd_elf64_size_dynamic_sections): Likewise. * bfd-in2.h: Rebuilt.
This commit is contained in:
@ -532,9 +532,9 @@ extern boolean bfd_elf32_record_link_assignment
|
|||||||
extern boolean bfd_elf64_record_link_assignment
|
extern boolean bfd_elf64_record_link_assignment
|
||||||
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
||||||
extern boolean bfd_elf32_size_dynamic_sections
|
extern boolean bfd_elf32_size_dynamic_sections
|
||||||
PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
|
PARAMS ((bfd *, const char *, struct bfd_link_info *, struct sec **));
|
||||||
extern boolean bfd_elf64_size_dynamic_sections
|
extern boolean bfd_elf64_size_dynamic_sections
|
||||||
PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
|
PARAMS ((bfd *, const char *, struct bfd_link_info *, struct sec **));
|
||||||
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
|
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
|
||||||
|
|
||||||
/* SunOS shared library support routines for the linker. */
|
/* SunOS shared library support routines for the linker. */
|
||||||
@ -1143,6 +1143,7 @@ enum complain_overflow
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned char bfd_byte;
|
typedef unsigned char bfd_byte;
|
||||||
|
typedef struct reloc_howto_struct reloc_howto_type;
|
||||||
|
|
||||||
struct reloc_howto_struct
|
struct reloc_howto_struct
|
||||||
{
|
{
|
||||||
@ -1236,7 +1237,6 @@ struct reloc_howto_struct
|
|||||||
boolean pcrel_offset;
|
boolean pcrel_offset;
|
||||||
|
|
||||||
};
|
};
|
||||||
typedef struct reloc_howto_struct reloc_howto_type;
|
|
||||||
#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
||||||
{(unsigned)C,R,S,B, P, BI, O,SF, 0,NAME,INPLACE,MASKSRC,MASKDST,PC}
|
{(unsigned)C,R,S,B, P, BI, O,SF, 0,NAME,INPLACE,MASKSRC,MASKDST,PC}
|
||||||
#define HOWTO2(C, R,S,B, P, BI, O, SF, SF1,NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
#define HOWTO2(C, R,S,B, P, BI, O, SF, SF1,NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
||||||
|
@ -2887,6 +2887,12 @@ elf_get_dynamic_symtab_upper_bound (abfd)
|
|||||||
long symtab_size;
|
long symtab_size;
|
||||||
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->dynsymtab_hdr;
|
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->dynsymtab_hdr;
|
||||||
|
|
||||||
|
if (elf_dynsymtab (abfd) == 0)
|
||||||
|
{
|
||||||
|
bfd_set_error (bfd_error_invalid_operation);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
symcount = hdr->sh_size / sizeof (Elf_External_Sym);
|
symcount = hdr->sh_size / sizeof (Elf_External_Sym);
|
||||||
symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
|
symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
|
||||||
|
|
||||||
@ -4657,8 +4663,9 @@ static const size_t elf_buckets[] =
|
|||||||
addresses of the various sections. */
|
addresses of the various sections. */
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
NAME(bfd_elf,size_dynamic_sections) (output_bfd, info, sinterpptr)
|
NAME(bfd_elf,size_dynamic_sections) (output_bfd, rpath, info, sinterpptr)
|
||||||
bfd *output_bfd;
|
bfd *output_bfd;
|
||||||
|
const char *rpath;
|
||||||
struct bfd_link_info *info;
|
struct bfd_link_info *info;
|
||||||
asection **sinterpptr;
|
asection **sinterpptr;
|
||||||
{
|
{
|
||||||
@ -4732,6 +4739,16 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, info, sinterpptr)
|
|||||||
|
|
||||||
elf_hash_table (info)->bucketcount = bucketcount;
|
elf_hash_table (info)->bucketcount = bucketcount;
|
||||||
|
|
||||||
|
if (rpath != NULL)
|
||||||
|
{
|
||||||
|
unsigned long indx;
|
||||||
|
|
||||||
|
indx = bfd_add_to_strtab (dynobj, elf_hash_table (info)->dynstr, rpath);
|
||||||
|
if (indx == (unsigned long) -1
|
||||||
|
|| ! elf_add_dynamic_entry (info, DT_RPATH, indx))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
s = bfd_get_section_by_name (dynobj, ".dynstr");
|
s = bfd_get_section_by_name (dynobj, ".dynstr");
|
||||||
BFD_ASSERT (s != NULL);
|
BFD_ASSERT (s != NULL);
|
||||||
s->_raw_size = elf_hash_table (info)->dynstr->length;
|
s->_raw_size = elf_hash_table (info)->dynstr->length;
|
||||||
|
Reference in New Issue
Block a user