David Wuertele | 15 Dec 2004 13:15

Repost: gcc cross mips output sizes too big

It's been a month and I still haven't found any answers.  Anyone here
know why object files have grown significantly since 2.95.3?

I've been using crosstool-generated gcc-3.3.3 to build my mipsel
targets, and I find that the file sizes are ginormous.  After
stripping the objects, I get file sizes that are up to TWICE as large
as similarly generated gcc-2.96 code.  Do these sizes not look out of
line?

   bytes          gcc-3.3.3 generated files
  -------       --------------------------------
  1884160	/lib/libc-2.3.2.so
  1257472	/lib/libstdc++.so.5.0.5
  1048576	/usr/local/lib/libfreetype.so.1314.0.0.10
  1036288	/bin/busybox
  1011712	/bin/bash

   bytes          gcc-2.96 generated files
  -------       --------------------------------
  1531904	/lib/libc-2.2.4.so
  532480	/lib/libstdc++-3-libc6.2-2-2.10.0.so
  495616	/usr/local/lib/libfreetype.so.1314.0.0.10
  462848	/bin/busybox
  847872	/bin/bash

Compiling with -Os helps, but doesn't get close to the file sizes I
saw with my older cross-compiler.  It seems strange to me that moving
to a newer compiler will reduce the number of programs I can ship in
my little NAND flash.

(Continue reading)

John Richard Moser | 16 Dec 2004 04:55
Picon

Generating shellcode at compile time


I need to generate some sort of strcpy()able shell code.  Probably
something to do

_exit(255);

would be quite enough; though more in-depth demonstrations would benefit
from being able to actually display a live exploit.  Something like
calling exec("/bin/bash") for example.

I'm working on an x86-64, but would like to be able to demonstrate
exploits and what PaX and the IBM stack smash protector do to stop them
on x86-64, x86, SPARC, PPC, SPARC64, and PPC64.

In the worst case, each shellcode could be individually created and
passed as a reaction to having the example daemon reveal the host type
(which may be useful in dual-host demonstrations where I could exploit a
PPC with an x86); however, I have not the time nor the need to invest my
time in generating such shellcode myself.

I'm not so sure what I want to do, but _exit(255) is fine for my
regression tests.

--
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

H. J. Lu | 20 Dec 2004 21:59

The Linux binutils 2.15.94.0.2 is released

This is the beta release of binutils 2.15.94.0.2 for Linux, which is
based on binutils 2004 1220 in CVS on sources.redhat.com plus various
changes. It is purely for Linux.

Please report any bugs related to binutils 2.15.94.0.2 to hjl <at> lucon.org

and

http://www.sourceware.org/bugzilla/

If you don't use

# rpmbuild -ta binutils-xx.xx.xx.xx.xx.tar.bz2

to compile the Linux binutils, please read patches/README in source
tree to apply Linux patches if there are any.

Changes from binutils 2.15.94.0.1:

1. Update from binutils 2004 1220.
2. Fix strip for TLS symbol references.

Changes from binutils 2.15.92.0.2:

1. Update from binutils 2004 1121.
2. Put ia64 .ctors/.dtors sections next to small data section for
Intel ia64 compiler.
3. Fix -Bdynamic/-Bstatic handling for linker script.
4. Provide more information on relocation overflow.
5. Add --sort-section to linker.
(Continue reading)

Denis Zaitsev | 20 Dec 2004 22:35
Picon

[PATCH] GCC 3.4.3: libobjc build failure

This patch is for exactly the same issue as described in

http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html

The fix is exactly the same, just another file is the target.  Without
it libobjc fails to build when --with-objc-gc is given to configure.

Please, apply it.

2004-12-21  Denis Zaitsev  <zzz <at> anda.ru>

	* libobjc/gc.c: Include coretypes.h and tm.h.

--- libobjc/gc.c.orig	2003-05-24 02:04:58.000000000 +0600
+++ libobjc/gc.c	2004-12-21 01:27:00.000000000 +0500
 <at>  <at>  -26,6 +26,8  <at>  <at>  Boston, MA 02111-1307, USA.  */
    the executable file might be covered by the GNU General Public License.  */

 #include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "objc.h"
 #include "encoding.h"

Andrew Pinski | 20 Dec 2004 22:38
Picon

Re: [PATCH] GCC 3.4.3: libobjc build failure


On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:

> This patch is for exactly the same issue as described in
>
> http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
>
> The fix is exactly the same, just another file is the target.  Without
> it libobjc fails to build when --with-objc-gc is given to configure.

This patch is incorrect as noted before.  I am going to reject it
as it was rejected before.  Again libobjc has no reason to include
these headers.

Thanks,
Andrew Pinski
libobjc maintainer

Denis Zaitsev | 20 Dec 2004 22:48
Picon

Re: [PATCH] GCC 3.4.3: libobjc build failure

On Mon, Dec 20, 2004 at 04:38:36PM -0500, Andrew Pinski wrote:
> 
> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
> 
> > This patch is for exactly the same issue as described in
> >
> > http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
> >
> > The fix is exactly the same, just another file is the target.  Without
> > it libobjc fails to build when --with-objc-gc is given to configure.
> 
> This patch is incorrect as noted before.  I am going to reject it
> as it was rejected before.  Again libobjc has no reason to include
> these headers.

a) The patches from the reference I've noted are already applied.

b) libobjc is not compiled without the new patch.  How should it be
   fixed then?

Zack Weinberg | 20 Dec 2004 22:50

Re: [PATCH] GCC 3.4.3: libobjc build failure

At Mon, 20 Dec 2004 16:38:36 -0500,
Andrew Pinski wrote:
> 
> 
> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
> 
> > This patch is for exactly the same issue as described in
> >
> > http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
> >
> > The fix is exactly the same, just another file is the target.  Without
> > it libobjc fails to build when --with-objc-gc is given to configure.
> 
> This patch is incorrect as noted before.  I am going to reject it
> as it was rejected before.  Again libobjc has no reason to include
> these headers.

The patch is the Wrong Thing in a formal sense.  However, it may be
the correct thing to do in the short term.  libobjc files have been
including coretypes.h and tm.h for a very long time; adding a few more
is not the end of the world, especially not on an old release branch!

zw

Andrew Pinski | 20 Dec 2004 22:53
Picon

Re: [PATCH] GCC 3.4.3: libobjc build failure


On Dec 20, 2004, at 4:48 PM, Denis Zaitsev wrote:

> On Mon, Dec 20, 2004 at 04:38:36PM -0500, Andrew Pinski wrote:
>>
>> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
>>
>>> This patch is for exactly the same issue as described in
>>>
>>> http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
>>>
>>> The fix is exactly the same, just another file is the target.  
>>> Without
>>> it libobjc fails to build when --with-objc-gc is given to configure.
>>
>> This patch is incorrect as noted before.  I am going to reject it
>> as it was rejected before.  Again libobjc has no reason to include
>> these headers.
>
> a) The patches from the reference I've noted are already applied.
Yes and the patch was submitted before, see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12035>.

> b) libobjc is not compiled without the new patch.  How should it be
>    fixed then?

The uses of the macros are not needed as shown by a "grep -r ."

Does this patch fix the problem for you?

(Continue reading)

Andrew Pinski | 20 Dec 2004 23:03
Picon

Re: [PATCH] GCC 3.4.3: libobjc build failure


On Dec 20, 2004, at 4:53 PM, Andrew Pinski wrote:
>
>> b) libobjc is not compiled without the new patch.  How should it be
>>    fixed then?
>
> The uses of the macros are not needed as shown by a "grep -r ."
>
> Does this patch fix the problem for you?

Actually that patch will not work, sorry about that.

This one is better and should work.

If it does not report the errors please as it will help to fix the
problem.

Thanks,
Andrew Pinski

Index: gc.c
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
retrieving revision 1.6
diff -u -p -r1.6 gc.c
--- gc.c	23 May 2003 20:04:58 -0000	1.6
+++ gc.c	20 Dec 2004 22:01:27 -0000
 <at>  <at>  -35,22 +35,12  <at>  <at>  Boston, MA 02111-1307, USA.  */
(Continue reading)

Denis Zaitsev | 20 Dec 2004 23:07
Picon

Re: [PATCH] GCC 3.4.3: libobjc build failure

On Mon, Dec 20, 2004 at 04:53:52PM -0500, Andrew Pinski wrote:

> The uses of the macros are not needed as shown by a "grep -r ."
> 
> Does this patch fix the problem for you?
> 
> Thanks,
> Andrew Pinski
> 

> Index: gc.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 gc.c
> --- gc.c	23 May 2003 20:04:58 -0000	1.6
> +++ gc.c	20 Dec 2004 21:51:20 -0000
>  <at>  <at>  -40,18 +40,6  <at>  <at>  Boston, MA 02111-1307, USA.  */
>  typedef GC_word word;
>  typedef GC_signed_word signed_word;
>  
> -#if BITS_PER_WORD == 32
> -# define LOGWL	5
> -# define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word	    */
> -#endif
> -
> -#if BITS_PER_WORD == 64
> -# define LOGWL 6
> -# define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word	    */
> -#endif
(Continue reading)


Gmane