Bug 21864 - xmalloc.o is compiled with -DMODULE_NAME=libc
Summary: xmalloc.o is compiled with -DMODULE_NAME=libc
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.27
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-29 23:32 UTC by H.J. Lu
Modified: 2017-08-21 17:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2017-07-29 23:32:39 UTC
xmalloc.o isn't in libc, but is compiled with -DMODULE_NAME=libc.
Comment 1 Sourceware Commits 2017-08-16 18:36:00 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pie/hidden has been created
        at  362d54c511c7668185ac6a37fb6d2042f9783567 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=362d54c511c7668185ac6a37fb6d2042f9783567

commit 362d54c511c7668185ac6a37fb6d2042f9783567
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Aug 13 07:37:34 2017 -0700

    Add hidden visibility to internal function prototypes
    
    Add hidden visibility to internal function prototypes to allow direct
    access to internal functions within libc.a without using GOT when the
    compiler defaults to -fPIE.
    
    Size comparison of elf/ldconfig when the compiler defaults to -fPIE:
    
    On x86-64:
            text	   data	    bss	    dec	    hex
    Before: 619646	  20132	   5488	 645266	  9d892
    After : 619502	  20132	   5488	 645122	  9d802
    On i686:
            text	   data	    bss	    dec	    hex
    Before: 550333	  10748	   3060	 564141	  89bad
    After : 546453	  10732	   3060	 560245	  88c75
    
    	* include/libc-symbols.h (__hidden_proto_hiddenattr): New for
    	the compiler defaulting to -fPIE.
    	(hidden_proto): Likewise.
    	(hidden_tls_proto): Likewise.
    	(__hidden_proto): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1760087874d21119ea4aa0f4624ea9a32fff84f9

commit 1760087874d21119ea4aa0f4624ea9a32fff84f9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Aug 13 07:00:22 2017 -0700

    Mark internal functions with attribute_hidden
    
    Mark internal functions with attribute_hidden to allow direct access to
    internal functions within libc.a without using GOT when the compiler
    defaults to -fPIE.
    
    	* iconv/gconv_int.h (__gconv_open): Add attribute_hidden.
    	(__gconv_close): Likewise.
    	(__gconv): Likewise.
    	(__gconv_find_transform): Likewise.
    	(__gconv_lookup_cache): Likewise.
    	(__gconv_compare_alias_cache): Likewise.
    	(__gconv_load_cache): Likewise.
    	(__gconv_get_path): Likewise.
    	(__gconv_close_transform): Likewise.
    	(__gconv_release_cache): Likewise.
    	(__gconv_find_shlib): Likewise.
    	(__gconv_release_shlib): Likewise.
    	(__gconv_get_builtin_trans): Likewise.
    	(__gconv_compare_alias): Likewise.
    	* include/dlfcn.h (_dlerror_run): Likewise.
    	* include/stdio.h (__fortify_fail_abort): Likewise.
    	* include/time.h (__tz_compute): Likewise.
    	(__strptime_internal): Likewise.
    	* intl/gettextP.h (_nl_find_domain): Likewise.
    	(_nl_load_domain): Likewise.
    	(_nl_find_msg): Likewise.
    	* intl/plural-exp.h (FREE_EXPRESSION): Likewise.
    	(EXTRACT_PLURAL_EXPRESSION): Likewise.
    	* locale/coll-lookup.h (__collidx_table_lookup): Likewise.
    	* resolv/gai_misc.h (__gai_enqueue_request): Likewise.
    	(__gai_find_request): Likewise.
    	(__gai_remove_request): Likewise.
    	(__gai_notify): Likewise.
    	(__gai_notify_only): Likewise.
    	* sysdeps/generic/aio_misc.h (__aio_sigqueue): Likewise.
    	* sysdeps/generic/ldsodefs.h (_dl_symbol_value): Likewise.
    	(_dl_fini): Likewise.
    	(_dl_non_dynamic_init): Likewise.
    	(_dl_aux_init): Likewise.
    	* sysdeps/i386/machine-gmon.h (mcount_internal): Likewise.
    	* sysdeps/unix/sysv/linux/i386/olddirent.h (__old_getdents64):
    	Likewise.
    	* wcsmbs/wcsmbsload.h (__wcsmbs_load_conv): Likewise.
    	(__wcsmbs_clone_conv): Likewise.
    	(__wcsmbs_named_conv): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=15e8f11ee4cf0de2ac89a3cdb0903a09a7039fe3

commit 15e8f11ee4cf0de2ac89a3cdb0903a09a7039fe3
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 10:42:48 2017 -0700

    Enable hidden visibility in libc.a compiled with PIE
    
    When building libc.a with PIE, enable hidden visibility to allow direct
    access to definitions within libc.a without using GOT.
    
    Size comparison of elf/ldconfig when the compiler defaults to -fPIE:
    
    On x86-64:
            text	   data	    bss	    dec	    hex
    Before: 619206	  20132	   5488	 644826	  9d6da
    After : 619062	  20132	   5488	 644682	  9d64a
    On i686:
            text	   data	    bss	    dec	    hex
    Before: 556305	  10816	   3056	 570177	  8b341
    After : 553688	  10756	   3056	 567500	  8a8cc
    
    	* include/libc-symbols.h (attribute_hidden): Enable hidden
    	visibility in libc.a compiled with PIE.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fae39ac3fb0774b837efeb947990151c97ddcc54

commit fae39ac3fb0774b837efeb947990151c97ddcc54
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 29 21:04:09 2017 -0700

    Don't compile non-lib modules as lib modules [BZ #21864]
    
    Some programs have more than one source files.  These non-lib modules
    should not be compiled with -DMODULE_NAME=libc.  This patch puts these
    non-lib modules in $(others-extras) and adds $(others-extras) to
    all-nonlib.
    
    	[BZ #21864]
    	* Makerules (all-nonlib): Add $(others-extras).
    	* catgets/Makefile (others-extras): New.
    	* elf/Makefile (others-extras): Likewise.
    	* nss/Makefile (others-extras): Likewise.

-----------------------------------------------------------------------
Comment 2 Sourceware Commits 2017-08-21 12:39:32 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7b3ce39538c890442a2e46b57bf1911ef7ab8ff8 (commit)
      from  54e4b8f21590d57ec9a2f2ad81a17c57e3b3984f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7b3ce39538c890442a2e46b57bf1911ef7ab8ff8

commit 7b3ce39538c890442a2e46b57bf1911ef7ab8ff8
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 29 21:04:09 2017 -0700

    Don't compile non-lib modules as lib modules [BZ #21864]
    
    Some programs have more than one source files.  These non-lib modules
    should not be compiled with -DMODULE_NAME=libc.  This patch puts these
    non-lib modules in $(others-extras) and adds $(others-extras) to
    all-nonlib.
    
    	[BZ #21864]
    	* Makerules (all-nonlib): Add $(others-extras).
    	* catgets/Makefile (others-extras): New.
    	* elf/Makefile (others-extras): Likewise.
    	* nss/Makefile (others-extras): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 Makerules        |    3 ++-
 catgets/Makefile |    1 +
 elf/Makefile     |    1 +
 nss/Makefile     |    1 +
 4 files changed, 5 insertions(+), 1 deletions(-)
Comment 3 H.J. Lu 2017-08-21 12:42:24 UTC
Fixed for 2.27.
Comment 4 Sourceware Commits 2017-08-21 17:30:41 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4504783c0f65b7074204c6126c6255ed89d6594e (commit)
      from  b5889d25e9bf944a89fdd7bcabf3b6c6f6bb6f7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4504783c0f65b7074204c6126c6255ed89d6594e

commit 4504783c0f65b7074204c6126c6255ed89d6594e
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Aug 21 19:28:54 2017 +0200

    benchtests: Do not compile benchmark objects as libc modules [BZ #21864]
    
    Otherwise, this will lead to link failures due to hidden symbol
    references.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    7 +++++++
 benchtests/Makefile |    9 +++++----
 2 files changed, 12 insertions(+), 4 deletions(-)