Author: dgilmore Date: 2011-03-12 19:47:42 -0500 (Sat, 12 Mar 2011) New Revision: 3516
Modified: trunk/osprey/libhugetlbfs/elflink.c Log: Fixed bug 744 - Programs compiled -pg and -HP:bdt option memory fault CR: Jian-Xin Lai and Mei Ye Modified: trunk/osprey/libhugetlbfs/elflink.c =================================================================== --- trunk/osprey/libhugetlbfs/elflink.c 2011-03-13 00:41:50 UTC (rev 3515) +++ trunk/osprey/libhugetlbfs/elflink.c 2011-03-13 00:47:42 UTC (rev 3516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2010 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (C) 2008-2011 Advanced Micro Devices, Inc. All Rights Reserved. */ /* @@ -681,9 +681,29 @@ if (save_phdr(htlb_num_segs, i, &info->dlpi_phdr[i])) return 1; + +#ifdef OPEN64_MOD + if (info->dlpi_phdr[i].p_flags & PF_W) { + struct seg_info *seg = &htlb_seg_table[htlb_num_segs]; + void *cur_brk = sbrk(0); + void *end_addr = seg->vaddr + seg->memsz; + if (end_addr != cur_brk) { + seg->extrasz = (cur_brk - seg->vaddr) - seg->filesz; + DEBUG("memory already allocated: end_addr=%p, cur_brk=%p\n", + end_addr, cur_brk); + } + /* No need to call get_extracopy, since we know we already need + * to copy past the address of any symbol that is in the dynamic + * symbol table. + */ + } else { + get_extracopy(&htlb_seg_table[htlb_num_segs], + &info->dlpi_phdr[0], info->dlpi_phnum); + } +#else get_extracopy(&htlb_seg_table[htlb_num_segs], &info->dlpi_phdr[0], info->dlpi_phnum); - +#endif htlb_num_segs++; } if (__hugetlbfs_debug) ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel