diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/emulparams/elf32ppccommon.sh | 2 | ||||
-rw-r--r-- | ld/emultempl/ppc32elf.em | 2 | ||||
-rw-r--r-- | ld/ldlang.c | 15 |
4 files changed, 17 insertions, 11 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index b8e926e0eea..53f9f941c59 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2014-05-20 Alan Modra <amodra@gmail.com> + + PR 16952 + * emulparams/elf32ppccommon.sh (_SDA_BASE_, _SDA2_BASE_): Delete. + * emultempl/ppc32elf.em (ppc_before_allocation): Call + ppc_elf_maybe_strip_sdata_syms. + * ldlang.c (size_input_section): Correct output_offset value + for excluded input sections. + 2014-05-16 John Marino <binutils@marino.st> * configure.tgt: Add /lib to dragonfly NATIVE_LIB_DIRS. diff --git a/ld/emulparams/elf32ppccommon.sh b/ld/emulparams/elf32ppccommon.sh index 049fdb987a5..1f54ef8056d 100644 --- a/ld/emulparams/elf32ppccommon.sh +++ b/ld/emulparams/elf32ppccommon.sh @@ -13,8 +13,6 @@ ARCH=powerpc:common MACHINE= EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' if test -z "${CREATE_SHLIB}"; then - SDATA_START_SYMBOLS="PROVIDE (_SDA_BASE_ = 32768);" - SDATA2_START_SYMBOLS="PROVIDE (_SDA2_BASE_ = 32768);" SBSS_START_SYMBOLS="PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);" SBSS_END_SYMBOLS="PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);" else diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index 069acd21dcc..0e2af12651a 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -135,6 +135,8 @@ ppc_before_allocation (void) gld${EMULATION_NAME}_before_allocation (); + ppc_elf_maybe_strip_sdata_syms (&link_info); + if (RELAXATION_ENABLED) params.branch_trampolines = 1; diff --git a/ld/ldlang.c b/ld/ldlang.c index 8d1e3f79049..7c076a2f78d 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -4608,12 +4608,15 @@ size_input_section { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; + asection *o = output_section_statement->bfd_section; - if (i->sec_info_type != SEC_INFO_TYPE_JUST_SYMS - && (i->flags & SEC_EXCLUDE) == 0) + if (i->sec_info_type == SEC_INFO_TYPE_JUST_SYMS) + i->output_offset = i->vma - o->vma; + else if ((i->flags & SEC_EXCLUDE) != 0) + i->output_offset = dot - o->vma; + else { bfd_size_type alignment_needed; - asection *o; /* Align this section first to the input sections requirement, then to the output section's requirement. If this alignment @@ -4623,7 +4626,6 @@ size_input_section if (output_section_statement->subsection_alignment != -1) i->alignment_power = output_section_statement->subsection_alignment; - o = output_section_statement->bfd_section; if (o->alignment_power < i->alignment_power) o->alignment_power = i->alignment_power; @@ -4636,17 +4638,12 @@ size_input_section } /* Remember where in the output section this input section goes. */ - i->output_offset = dot - o->vma; /* Mark how big the output section must be to contain this now. */ dot += TO_ADDR (i->size); o->size = TO_SIZE (dot - o->vma); } - else - { - i->output_offset = i->vma - output_section_statement->bfd_section->vma; - } return dot; } |