Closed Bug 411954 Opened 12 years ago Closed 12 years ago

I know how to strip a binary's symbol table of all non-global symbols except for text symbols. I also know how to strip LC_CODE_SIGNATURE load commands once they've been added.


(Camino Graveyard :: General, defect)

1.8 Branch
Not set


(Not tracked)



(Reporter: mark, Assigned: mark)



(Keywords: fixed1.8.1.12)


(2 files)

This should take care of bug 407779.  I also alluded to it in bug 409849 comment 4.
The only interesting bits in attachment 296565 [details] [diff] [review] are at the top, the changes to:


Everything else in that patch comes straight out of Apple's cctools-667.3 package (see the README), except for tease.c.  tease.c is a modified version of cctools' strip.c.  This diff contains the differences between strip.c and tease.c.
tease can also be used to remove code signatures from binaries, as discussed in bug 409459 comment 5.
No longer blocks: 407779
Blocks: 407779
We need to know whether it's cool to land APSL stuff in the tree.  It's for a build-time tool only, none of the stuff here would be distributed.
Comment on attachment 296566 [details] [diff] [review]
diff between strip.c and tease.c

I should probably also document "tease -a" in the README.
This needs to block 1.6, and probably b2 if not b1.  Sam was supposed to be checking about APSL code.
Flags: camino1.6b2?
Flags: camino1.6b1?
Flags: camino1.6+
Target Milestone: --- → Camino1.6
Comment on attachment 296566 [details] [diff] [review]
diff between strip.c and tease.c

I don't really know who else to send this review to.  :(
Attachment #296566 - Flags: review?(stuart.morgan)
Comment on attachment 296565 [details] [diff] [review]
Add striptease to mozilla/camino

Smokey, just the Makefile and the README, please.
Attachment #296565 - Flags: review?(alqahira)
Flags: camino1.6b1? → camino1.6b1-
Comment on attachment 296565 [details] [diff] [review]
Add striptease to mozilla/camino

Looks good (though I'm not fond of all the warnings it generates during compilation).  Please do document -a as you mentioned in comment 5; r=ardissone with that.
Attachment #296565 - Flags: review?(alqahira) → review+
Comment on attachment 296566 [details] [diff] [review]
diff between strip.c and tease.c

>+ * No -x (strip all local), and either -S (strip
>+ * debug), -X (strip 'L' local), or -t (strip
>+ * local except non-'L' text) was given.

s/either/one of/

>+	if(cflag){
>+	    /*
>+	     * To get the right amount of the file copied out by writeout() for

I didn't follow how adding this if(cflag) wrapper was related to your change.

To the extent that I understood this patch though, it looks fine, so r=me
Attachment #296566 - Flags: review?(stuart.morgan) → review+
The if(cflag) thing was added to a chunk of code that previously only executed if cflag was set - the strip_LC_CODE_SIGNATURE_commands function.  The diff between strip and tease changes that function to execute if either cflag or no_code_signature is set.  Only some of that function actually makes sense to use for the no_code_signature case.  The rest is really specific to the combination of -c and code signature stripping.  I had to keep that section cflag-only, so that it wouldn't ruin the Mach-O output if the user wanted to perform the simpler task of stripping the LC_CODE_SIGNATURE load command only without generating a stub executable.
Smokey, the warnings suck, but they're Apple's warnings.  I wanted to keep this a minimal-change thing (at least for the initial landing).  Boo to Apple for naming one of their "libstuff" functions "round", the name of a libc (or libm or libmx) function usually provided by a gcc built-in.
Blocks: 413527
Checked in on the trunk and MOZILLA_1_8_BRANCH for 1.6b3.

This adds and builds striptease, we'll start using it in bug 413527 to fix bug 407779.
Closed: 12 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Flags: camino1.6b3? → camino1.6b3+
Blocks: 414397
You need to log in before you can comment on or make changes to this bug.