okay, i'm not at all familiar with binutils, but just studying which files were changed by this patch and excluding build, packaging, translation, and non-amd64 arches, i am left with these three patches: --- binutils-2.19.91.20091006/gas/read.c 2009-09-15 13:27:21.000000000 +0100 +++ binutils-2.19.91.20091014/gas/read.c 2009-10-07 09:35:59.000000000 +0100 @@ -3911,7 +3911,7 @@ if (*input_line_pointer == ',') { ++input_line_pointer; - expression_and_evaluate (&exp); + expression (&exp); } switch (exp.X_op) { --- binutils-2.19.91.20091006/gas/symbols.c 2009-09-27 10:57:37.000000000 +0100 +++ binutils-2.19.91.20091014/gas/symbols.c 2009-10-07 09:36:44.000000000 +0100 @@ -1514,10 +1514,7 @@ } } - /* Never change a defined symbol. */ - if (symbolP->bsym->section == undefined_section - || symbolP->bsym->section == expr_section) - *symbolPP = symbolP; + *symbolPP = symbolP; *valueP = expr.X_add_number; *segP = symbolP->bsym->section; *fragPP = symbolP->sy_frag; --- binutils-2.19.91.20091006/ld/scripttempl/elf.sc 2009-09-29 10:51:03.000000000 +0100 +++ binutils-2.19.91.20091014/ld/scripttempl/elf.sc 2009-10-09 06:43:07.000000000 +0100 @@ -110,42 +110,42 @@ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then - INITIAL_READONLY_SECTIONS=".interp : { *(.interp) }" + INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" fi if test -z "$PLT"; then - IPLT=".iplt : { *(.iplt) }" - PLT=".plt : { *(.plt)${IREL_IN_PLT+ *(.iplt)} } + IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" + PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} } ${IREL_IN_PLT-$IPLT}" fi test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes if test -z "$GOT"; then if test -z "$SEPARATE_GOTPLT"; then - GOT=".got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }" + GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }" else - GOT=".got : { *(.got) *(.igot) }" - GOTPLT=".got.plt : { *(.got.plt) *(.igot.plt) }" + GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" + GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" fi fi -REL_IFUNC=".rel.ifunc : { *(.rel.ifunc) }" -RELA_IFUNC=".rela.ifunc : { *(.rela.ifunc) }" -REL_IPLT=".rel.iplt : +REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" +RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }" +REL_IPLT=".rel.iplt ${RELOCATING-0} : { ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}} *(.rel.iplt) ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}} }" -RELA_IPLT=".rela.iplt : +RELA_IPLT=".rela.iplt ${RELOCATING-0} : { ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}} *(.rela.iplt) ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}} }" -DYNAMIC=".dynamic : { *(.dynamic) }" -RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" +DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" +RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" if test -z "${NO_SMALL_DATA}"; then - SBSS=".sbss : + SBSS=".sbss ${RELOCATING-0} : { ${RELOCATING+${SBSS_START_SYMBOLS}} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} @@ -154,29 +154,29 @@ *(.scommon) ${RELOCATING+${SBSS_END_SYMBOLS}} }" - SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" + SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SDATA="/* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata : + .sdata ${RELOCATING-0} : { ${RELOCATING+${SDATA_START_SYMBOLS}} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) }" - SDATA2=".sdata2 : + SDATA2=".sdata2 ${RELOCATING-0} : { ${RELOCATING+${SDATA2_START_SYMBOLS}} *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" - REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } - .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" - REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } - .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" - REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } - .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" - REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } - .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" + REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } + .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" + REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } + .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" + REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } + .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" + REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } + .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" else NO_SMALL_DATA=" " fi @@ -192,31 +192,31 @@ fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test "${LARGE_SECTIONS}" = "yes" && REL_LARGE=" - .rel.ldata : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } - .rela.ldata : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) } - .rel.lbss : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } - .rela.lbss : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) } - .rel.lrodata : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } - .rela.lrodata : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" + .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } + .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) } + .rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } + .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) } + .rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } + .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS=" ${OTHER_BSS_SECTIONS} - .lbss : + .lbss ${RELOCATING-0} : { *(.dynlbss) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(LARGE_COMMON) }" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" - .lrodata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : + .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : { *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) } - .ldata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : + .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : { *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} }" -CTOR=".ctors : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -242,7 +242,7 @@ KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} }" -DTOR=".dtors : +DTOR=".dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} KEEP (*crtbegin.o(.dtors)) @@ -252,7 +252,7 @@ KEEP (*(.dtors)) ${CONSTRUCTING+${DTOR_END}} }" -STACK=" .stack ${RELOCATING+${STACK_ADDR}} : +STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : { ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;} *(.stack) @@ -277,6 +277,10 @@ ${RELOCATING+${LIB_SEARCH_DIRS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${INPUT_FILES}} +${RELOCATING- /* For some reason, the Solaris linker makes bad executables + if gld -r is used and the intermediate file has sections starting + at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld + bug. But for now assigning the zero vmas works. */} SECTIONS { @@ -292,13 +296,13 @@ test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC= cat > ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ @@ -362,14 +366,14 @@ fi cat >> ldscripts/dyntmp.$$ <