On Mon, 2007-04-02 at 18:27 -0700, Nishanth Aravamudan wrote:
> ppc: rework plt detection
>
> We currently emit LONG(0) into the .plt section of relinked ppc binaries
> to make it appear in the filesz (on-disk) portion of the data/bss
> segment. This is a problem, however, for powerpc64, where the ABI
> specifies that the .plt section is NOBITS (x86 and x86_64 mark the .plt
> PROGBITS). Given that the program is being relinked to begin with,
> however, it seems logical to simply add a tag, similar to
> __executable_start, to make finding the "libhuge" filesz easy to find.
> Do exactly this, via __libhuge_filesz, and skip the extracopy detection
> if this symbol is defined. Tested on powerpc64.
Looks good to me...
What do you think about adding some comments into the linker scripts
here so it will be easy to remember what this is for later?
> diff --git a/ldscripts/elf32ppclinux.xBDT b/ldscripts/elf32ppclinux.xBDT
> index f30bd3b..2dd8e8f 100644
> --- a/ldscripts/elf32ppclinux.xBDT
> +++ b/ldscripts/elf32ppclinux.xBDT
> @@ -163,7 +163,8 @@ SECTIONS
> /* . = DATA_SEGMENT_RELRO_END (0, .); */
> /* Ensure the plt appears in the on-disk portion of the binary so it
> * will be copied during hugetlb remapping */
> - .plt : { *(.plt) LONG(0) } :hdata
> + .plt : { *(.plt) } :hdata
> + __libhuge_filesz = .;
> .data :
> {
> *(.data .data.* .gnu.linkonce.d.*)
> diff --git a/ldscripts/elf64ppc.xBDT b/ldscripts/elf64ppc.xBDT
> index 68abf09..4e2f163 100644
> --- a/ldscripts/elf64ppc.xBDT
> +++ b/ldscripts/elf64ppc.xBDT
> @@ -181,7 +181,8 @@ SECTIONS
> } :hdata
> /* Ensure the plt appears in the on-disk portion of the binary so it
> * will be copied during hugetlb remapping */
> - .plt : { LONG(0) *(.plt) } :hdata
> + .plt : { *(.plt) } :hdata
> + __libhuge_filesz = .;
> .bss :
> {
> *(.dynbss)
>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel