source: trunk/dports/devel/ld64/files/ld64-85-no_pie.patch @ 92369

Last change on this file since 92369 was 92369, checked in by jeremyhu@…, 5 years ago

ld64: Remove the LD_NO_PIE hunk as it's not needed

File size: 3.2 KB
  • doc/man/man1/ld.1

    diff -Naurp ld64-85.2.1.orig/doc/man/man1/ld.1 ld64-85.2.1/doc/man/man1/ld.1
    This option is also called -dylib_curren 
    289289.Ss Options when creating a main executable
    290290.Bl -tag
    291291.It Fl pie
    292 This makes a special kind of main executable that is position independent (PIE).  On Mac OS X 10.5, the OS
     292This makes a special kind of main executable that is position independent (PIE).  On Mac OS X 10.5 and later, the OS
    293293will load a PIE at a random address each time it is executed.  You cannot create a PIE from .o files compiled
    294294with -mdynamic-no-pic.  That means the codegen is less optimal, but the address randomization adds some
    295295security.
     296.It Fl no_pie
     297Do not make a position independent executable (PIE).  This is the default.
    296298.It Fl pagezero_size Ar size
    297299By default the linker creates an unreadable segment starting at address zero named __PAGEZERO.  Its existence
    298300will cause a bus error if a NULL pointer is dereferenced.  The argument
  • src/Options.cpp

    diff -Naurp ld64-85.2.1.orig/src/Options.cpp ld64-85.2.1/src/Options.cpp
    Options::Options(int argc, const char* a 
    9595          fVerbose(false), fKeepRelocations(false), fWarnStabs(false),
    9696          fTraceDylibSearching(false), fPause(false), fStatistics(false), fPrintOptions(false),
    9797          fSharedRegionEligible(false), fPrintOrderFileStatistics(false), 
    98           fReadOnlyx86Stubs(false), fPositionIndependentExecutable(false), fMaxMinimumHeaderPad(false),
     98          fReadOnlyx86Stubs(false), fPositionIndependentExecutable(false),
     99          fDisablePositionIndependentExecutable(false), fMaxMinimumHeaderPad(false),
    99100          fDeadStripDylibs(false),  fAllowTextRelocs(false), fWarnTextRelocs(false),
    100101          fUsingLazyDylibLinking(false), fEncryptable(true), fSaveTempFiles(false)
    101102{
    void Options::parse(int argc, const char 
    22862287                        else if ( strcmp(arg, "-pie") == 0 ) {
    22872288                                fPositionIndependentExecutable = true;
    22882289                        }
     2290                        else if ( strcmp(arg, "-no_pie") == 0 ) {
     2291                                fDisablePositionIndependentExecutable = true;
     2292                        }
    22892293                        else if ( strncmp(arg, "-reexport-l", 11) == 0 ) {
    22902294                                FileInfo info = findLibrary(&arg[11], true);
    22912295                                info.options.fReExport = true;
    void Options::checkIllegalOptionCombinat 
    30503059                }
    30513060        }
    30523061       
     3062        // -no_pie anywhere on command line disable PIE
     3063        if ( fDisablePositionIndependentExecutable )
     3064                fPositionIndependentExecutable = false;
     3065
    30533066        // check -pie is only used when building a dynamic main executable for 10.5
    30543067        if ( fPositionIndependentExecutable ) {
    30553068                if ( fOutputKind != Options::kDynamicExecutable )
    30563069                        throw "-pie can only be used when linking a main executable";
  • src/Options.h

    diff -Naurp ld64-85.2.1.orig/src/Options.h ld64-85.2.1/src/Options.h
    private: 
    341341        bool                                                            fPrintOrderFileStatistics;
    342342        bool                                                            fReadOnlyx86Stubs;
    343343        bool                                                            fPositionIndependentExecutable;
     344        bool                                                            fDisablePositionIndependentExecutable;
    344345        bool                                                            fMaxMinimumHeaderPad;
    345346        bool                                                            fDeadStripDylibs;
    346347        bool                                                            fAllowTextRelocs;
Note: See TracBrowser for help on using the repository browser.