public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
From: Kfir Lavi <lavi.kfir@gmail.com>
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] Tool for eliminating non used code or symbols?
Date: Sun, 14 Apr 2013 16:07:30 +0300	[thread overview]
Message-ID: <CAHNvW1Kc8GNF=d1p+EAaFTH6s_oiZSHv4=O4YUZSMVDDqugaLw@mail.gmail.com> (raw)
In-Reply-To: <CAG2jQ8iCEzi18JBhW5wwmJoMP56RxeUC67+YLePjY0nHUBNBKQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

On Sat, Mar 30, 2013 at 4:09 AM, Markos Chandras <hwoarang@gentoo.org>wrote:

> On 25 March 2013 07:01, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> > Hi,
> > I'm looking for a way to reduce glibc code size.
> > It can be a way to make system smaller and minimize the impact
> > of attack vectors in glibc, as in return-to-libc attack.
> >
> > Lets say I'm deleting the program 'mkdir', and mkdir uses a function
> > in glibc that non of the other parts of the system uses.
> > Then I want to eliminate this function from glibc. This leads to smaller
> > code and if this function is used in some attack scenario, maybe prevent
> it.
> >
> > Is there a way to do it?
> > Can you help me think how to build a tool like this? or, integrate
> > with existing tools.
> >
> > Thanks,
> > Kfir
> >
>
> You can use -Os when you compile your packages to reduce the size of
> the resulting ELF file.
> As for the second part of your question, I am not sure if this is
> possible. I haven't thought this through, but
> assuming you know no other packages depend on the function you want to
> remove, you will have to mess
> with the ELF file and its plt and other section entries to remove all
> the references of that symbol. It's likely you
> will break the file in the end.
>
> --
> Regards,
> Markos Chandras - Gentoo Linux Developer
> http://dev.gentoo.org/~hwoarang
>
> Yes you right,
This is why I want to remove the function from the sources and compile it
again.

Kfir

[-- Attachment #2: Type: text/html, Size: 2079 bytes --]

  reply	other threads:[~2013-04-14 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25  7:01 [gentoo-embedded] Tool for eliminating non used code or symbols? Kfir Lavi
2013-03-30  1:09 ` Markos Chandras
2013-04-14 13:07   ` Kfir Lavi [this message]
2013-04-26 20:03 ` Mike Frysinger
2013-04-29  3:58   ` Kfir Lavi
2013-05-27 13:09 ` Bertrand Jacquin
2013-05-31 18:10   ` Christopher Friedt
2013-05-31 18:11     ` Christopher Friedt
2013-06-22  0:23       ` Mike Frysinger
2013-06-22 10:05         ` Anthony G. Basile
2013-06-25 17:44           ` Christopher Friedt
2013-06-30 12:01   ` Kfir Lavi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHNvW1Kc8GNF=d1p+EAaFTH6s_oiZSHv4=O4YUZSMVDDqugaLw@mail.gmail.com' \
    --to=lavi.kfir@gmail.com \
    --cc=gentoo-embedded@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox