• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES


  • Subject: Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
  • From: Markus Hitter <email@hidden>
  • Date: Tue, 1 Mar 2005 00:53:11 +0100


Am 28.02.2005 um 12:48 schrieb Brian Dantes:

I'm trying to port an LD_PRELOAD trick from Linux to MacOS X. Given the
following two files:

foo.c:
------
[...]
void __attribute__((constructor)) my_init() {
  printf("Constructor called!\n");
}

bar.c:
------
int main() {
  return 0;
}

If I change the code such that bar.c references some symbol in foo.c, and link bar directly with the library, it works as expected[Constructor is called].

I'd say it works both times correctly and Linux wastes cycles with constructing unneeded objects. Loading is not constructing.



my 2 cents

Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
      • From: Brian Dantes <email@hidden>
References: 
 >__attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES (From: Brian Dantes <email@hidden>)

  • Prev by Date: Re: DSS & JMF
  • Next by Date: Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
  • Previous by thread: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
  • Next by thread: Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
  • Index(es):
    • Date
    • Thread