From 229fcec57051103b79422353f53b6053fc5fc4b4 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 6 Sep 2004 20:55:23 +0000 Subject: * elf-bfd.h (_bfd_elf_make_dynamic_segment): Declare it. * elf.c (_bfd_elf_make_dynamic_segment): New function, split out from ... (map_sections_to_segments): ... here. Use it. Assign a file position to the .dynamic section if it is not loadable, but part of the PT_DYNAMIC segment. * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file offsets, not VMAs, for the BPABI. Do not fill in the header in the .got.plt section for the BPABI. * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a PT_DYNAMIC segment. (elf_backend_want_got_plt): Define to zero for Symbian OS. * emulparams/armsymbian.sh: Use armbpabi script. * scripttempl/armbpabi.sc: New script. --- bfd/elfarm-nabi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bfd/elfarm-nabi.c') diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c index 7c6e7c2..6644578 100644 --- a/bfd/elfarm-nabi.c +++ b/bfd/elfarm-nabi.c @@ -936,6 +936,7 @@ elf32_arm_symbian_modify_segment_map (abfd, info) struct bfd_link_info *info ATTRIBUTE_UNUSED; { struct elf_segment_map *m; + asection *dynsec; /* The first PT_LOAD segment will have the program headers and file headers in it by default -- but BPABI object files should not @@ -946,6 +947,19 @@ elf32_arm_symbian_modify_segment_map (abfd, info) m->includes_filehdr = 0; m->includes_phdrs = 0; } + + /* BPABI shared libraries and executables should have a PT_DYNAMIC + segment. However, because the .dynamic section is not marked + with SEC_LOAD, the generic ELF code will not create such a + segment. */ + dynsec = bfd_get_section_by_name (abfd, ".dynamic"); + if (dynsec) + { + m = _bfd_elf_make_dynamic_segment (abfd, dynsec); + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } + return TRUE; } @@ -970,5 +984,9 @@ elf32_arm_symbian_modify_segment_map (abfd, info) #undef elf_backend_got_header_size #define elf_backend_got_header_size 0 +/* Similarly, there is no .got.plt section. */ +#undef elf_backend_want_got_plt +#define elf_backend_want_got_plt 0 + #include "elf32-target.h" -- cgit v1.1