mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
Merge pull request #10 from joonicks/cleanup-update
Hostinfo & ldscript
This commit is contained in:
3
VERSIONS
3
VERSIONS
@@ -1,5 +1,8 @@
|
||||
3.0.99p4 -- WORK IN PROGRESS (~March, 2018)
|
||||
|
||||
* Added: New host information commands: HOSTINFO, MEMINFO, CPUINFO.
|
||||
* Added: New configuration option: hostinfo
|
||||
* Fixed: Custom ld script fintuning the core order.
|
||||
* Changed: Rewrite of ALIAS aliasing routine, adding features.
|
||||
* Fixed: RawDNS, again...
|
||||
* Fixed: Save procvars only once in session file.
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
#define S(x) x,sizeof(x)
|
||||
|
||||
__page(".text.e")
|
||||
#if 0
|
||||
*(.text.e) /* RARE */
|
||||
*(.text.d) /* INIT */ main
|
||||
*(.text.b) /* CFG1 */ func2
|
||||
*(.text.c) /* CMD1 */ func1
|
||||
*(.text.a) /* CORE */
|
||||
*(.text.f) /* DBUG */
|
||||
#endif
|
||||
|
||||
__page(".text.c")
|
||||
int function1(int a)
|
||||
{
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
__page(".text.c")
|
||||
__page(".text.b")
|
||||
int function2(int a)
|
||||
{
|
||||
return a + 2;
|
||||
@@ -24,7 +33,7 @@ int function2(int a)
|
||||
__page(".text.d")
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (((void*)main < (void*)function1) && ((void*)function1 < (void*)function2))
|
||||
if (((void*)main < (void*)function2) && ((void*)function2 < (void*)function1))
|
||||
write(1,S("yes\n"));
|
||||
else
|
||||
write(1,S("no\n"));
|
||||
|
||||
21
configure
vendored
21
configure
vendored
@@ -59,6 +59,7 @@ do
|
||||
dynamode ) ft_dynamode=$yesno ;;
|
||||
dyncmd ) ft_dyncmd=$yesno ;;
|
||||
greet ) ft_greet=$yesno ;;
|
||||
hostinfo ) ft_hostinfo=$yesno ;;
|
||||
idwrap ) ft_idwrap=$yesno ;;
|
||||
ircd_ext ) ft_ircd_ext=$yesno ;;
|
||||
md5 ) ft_md5=$yesno ;;
|
||||
@@ -107,7 +108,7 @@ do
|
||||
|
||||
case "$feature" in
|
||||
debug | botnet | telnet | alias | seen | session | dyncmd | newbie | wingate | md5 | sha \
|
||||
| ctcp | dccfile | uptime | redirect | greet | perl | profiling | tcl | dynamode | web \
|
||||
| ctcp | dccfile | uptime | redirect | greet | perl | profiling | tcl | dynamode | web | hostinfo \
|
||||
| note | notify | trivia | toybox | bounce | stats | rawdns | ircd_ext | idwrap | chanban | python )
|
||||
case _"$optarg"_ in
|
||||
_yes_ | _no_ | __ )
|
||||
@@ -152,6 +153,8 @@ do
|
||||
dyncmd_no ) ft_dyncmd=no ;;
|
||||
greet_yes | greet_ ) ft_greet=yes ;;
|
||||
greet_no ) ft_greet=no ;;
|
||||
hostinfo_yes | hostinfo_ ) ft_hostinfo=yes ;;
|
||||
hostinfo_no ) ft_hostinfo=no ;;
|
||||
idwrap_yes | idwrap_ ) ft_idwrap=yes ;;
|
||||
idwrap_no ) ft_idwrap=no ;;
|
||||
ircd_ext_yes | ircd_ext_ ) ft_ircd_ext=yes ;;
|
||||
@@ -210,6 +213,7 @@ do
|
||||
dynamode ) ft_dynamode=no ;;
|
||||
dyncmd ) ft_dyncmd=no ;;
|
||||
greet ) ft_greet=no ;;
|
||||
hostinfo ) ft_hostinfo=no ;;
|
||||
idwrap ) ft_idwrap=no ;;
|
||||
ircd_ext ) ft_ircd_ext=no ;;
|
||||
md5 ) ft_md5=no ;;
|
||||
@@ -258,6 +262,7 @@ do
|
||||
ft_dynamode=yes
|
||||
ft_dyncmd=yes
|
||||
ft_greet=yes
|
||||
ft_hostinfo=yes
|
||||
ft_ircd_ext=yes
|
||||
ft_md5=yes
|
||||
ft_newbie=yes
|
||||
@@ -296,6 +301,8 @@ Features and packages:
|
||||
--with-botnet Botnet support
|
||||
--with-debug Debug support
|
||||
--with-dyncmd Dynamic command levels support
|
||||
--with-hostinfo Support for code that reveals/displays/shares information about the host
|
||||
that the bot is running on.
|
||||
--with-newbie Newbie support
|
||||
--with-profiling Profiling (gcc+gprof)
|
||||
--with-seen SEEN support
|
||||
@@ -876,10 +883,10 @@ TESTC=config/ldtest.c
|
||||
|
||||
echo $ac_n "checking for friendly ld ... "$ac_c
|
||||
|
||||
$CC -o $TESTP $TESTC -Wl,-T,src/ld/mech.ldscript 1> /dev/null 2> /dev/null
|
||||
$CC -o $TESTP $TESTC -Wl,-T,src/ld/elf64-x86-64 1> /dev/null 2> /dev/null
|
||||
if [ -x $TESTP ]; then
|
||||
if [ `$TESTP` = "yes" ]; then
|
||||
ldscript='-Wl,-T,ld/mech.ldscript'
|
||||
ldscript='-Wl,-T,ld/elf64-x86-64'
|
||||
has_ldscript=yes
|
||||
fi
|
||||
fi
|
||||
@@ -1058,6 +1065,13 @@ else
|
||||
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes -o "$ans" = internal && def_sha='#define SHACRYPT'
|
||||
fi
|
||||
|
||||
def_hostinfo='#undef HOSTINFO'
|
||||
unset ans
|
||||
echo $ac_n "Host info support? ......................... [Y/n] "$ac_c
|
||||
test "$ft_hostinfo" && echo "$ft_hostinfo" && ans=$ft_hostinfo
|
||||
test -z "$ft_hostinfo" && read ans
|
||||
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_hostinfo='#define HOSTINFO'
|
||||
|
||||
def_newbie='#undef NEWBIE'
|
||||
unset ans
|
||||
echo $ac_n "Newbie support? ............................ [Y/n] "$ac_c
|
||||
@@ -1231,6 +1245,7 @@ sed "
|
||||
s|@DEF_DYNCMD@|$def_dyncmd|;
|
||||
s|@DEF_DYNAMODE@|$def_dynamode|;
|
||||
s|@DEF_GREET@|$def_greet|;
|
||||
s|@DEF_HOSTINFO@|$def_hostinfo|;
|
||||
s|@DEF_IDWRAP@|$def_idwrap|;
|
||||
s|@DEF_IRCD_EXT@|$def_ircd_ext|;
|
||||
s|@DEF_MD5@|$def_md5|;
|
||||
|
||||
@@ -43,14 +43,14 @@ CHMOD = chmod
|
||||
INCS = config.h mcmd.h defines.h global.h h.h structs.h text.h
|
||||
|
||||
OFILES = alias.o auth.o bounce.o chanban.o channel.o core.o \
|
||||
ctcp.o debug.o dns.o dynamode.o function.o greet.o help.o irc.o \
|
||||
ctcp.o debug.o dns.o dynamode.o function.o greet.o help.o hostinfo.o irc.o \
|
||||
kicksay.o main.o net.o net_chan.o note.o notify.o ons.o parse.o \
|
||||
perl.o prot.o python.o redirect.o reset.o seen.o shit.o socket.o \
|
||||
spy.o stats.o tcl.o telnet.o toybox.o trivia.o uptime.o \
|
||||
user.o vars.o web.o @MD5_O@ @SHA_O@
|
||||
|
||||
SRCFILES = alias.c auth.c bounce.c chanban.c channel.c core.c \
|
||||
ctcp.c debug.c dns.c dynamode.c function.c greet.c help.c irc.c \
|
||||
ctcp.c debug.c dns.c dynamode.c function.c greet.c help.c hostinfo.c irc.c \
|
||||
kicksay.c main.c net.c net_chan.c note.c notify.c ons.c parse.c \
|
||||
perl.c prot.c python.c redirect.c reset.c seen.c shit.c socket.c \
|
||||
spy.c stats.c tcl.c telnet.c toybox.c trivia.c uptime.c \
|
||||
@@ -155,6 +155,9 @@ greet.o: greet.c $(INCS)
|
||||
help.o: help.c $(INCS) usage.h
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -c $< $(CPROF)
|
||||
|
||||
hostinfo.o: hostinfo.c $(INCS)
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -c $< $(CPROF)
|
||||
|
||||
irc.o: irc.c $(INCS)
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -c $< $(CPROF)
|
||||
|
||||
|
||||
@@ -159,7 +159,9 @@ void afmt(char *copy_to, const char *src, const char *input)
|
||||
argend++;
|
||||
}
|
||||
}
|
||||
// debug("args #%i-#%i, characters %i-%i\n",startnum,endnum,argstart-input,argend-input);
|
||||
#ifdef DEBUG
|
||||
debug("(afmt) args #%i-#%i, characters %i-%i\n",startnum,endnum,argstart-input,argend-input);
|
||||
#endif /* DEBUG */
|
||||
while(*argstart && argstart < argend && dest <= BUFTAIL)
|
||||
*(dest++) = *(argstart++);
|
||||
continue;
|
||||
@@ -169,7 +171,9 @@ void afmt(char *copy_to, const char *src, const char *input)
|
||||
*(dest++) = *(src++);
|
||||
}
|
||||
*dest = 0;
|
||||
// debug("start %i end %i spc %i\n",startnum,endnum,spc);
|
||||
#ifdef DEBUG
|
||||
debug("(afmt) start %i end %i spc %i\n",startnum,endnum,spc);
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
#ifndef ALIASTEST
|
||||
|
||||
@@ -187,6 +187,11 @@
|
||||
#undef CHANBAN
|
||||
#endif /* IRCD_EXTENSIONS */
|
||||
|
||||
/*
|
||||
* HOSTINFO: share information about the host that the bot is running on
|
||||
*/
|
||||
@DEF_HOSTINFO@
|
||||
|
||||
/*
|
||||
* FASTNICK: faster nick regain if the nick is seen when released
|
||||
* Enables code that is potentially dangerous if an attacker aquires
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 1997-2009 proton
|
||||
Copyright (c) 1997-2018 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -223,6 +223,11 @@ struct
|
||||
/*
|
||||
* Level 100
|
||||
*/
|
||||
#ifdef HOSTINFO
|
||||
{ 0, "HOSTINFO", "do_hostinfo", 100 | CCPW | GAXS },
|
||||
{ 0, "MEMINFO", "do_meminfo", 100 | CCPW | GAXS },
|
||||
{ 0, "CPUINFO", "do_cpuinfo", 100 | CCPW | GAXS },
|
||||
#endif /* HOSTINFO */
|
||||
#ifdef RAWDNS
|
||||
{ 0, "DNSSERVER", "do_dnsserver", 100 | CCPW | GAXS },
|
||||
{ 0, "DNSROOT", "do_dnsroot", 100 | CCPW | GAXS | CARGS },
|
||||
|
||||
7
src/h.h
7
src/h.h
@@ -581,6 +581,13 @@ LS void check_dynamode(Chan *) __page(CORE_SEG);
|
||||
|
||||
#endif /* DYNAMODE */
|
||||
|
||||
#ifdef HOSTINFO
|
||||
|
||||
LS void do_hostinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_meminfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_cpuinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
#endif /* HOSTINFO */
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
120
src/hostinfo.c
Normal file
120
src/hostinfo.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 2001-2018 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
#define HOSTINFO_C
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HOSTINFO
|
||||
#include "defines.h"
|
||||
#include "structs.h"
|
||||
#include "global.h"
|
||||
#include "h.h"
|
||||
#include "text.h"
|
||||
#include "mcmd.h"
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
void do_hostinfo(COMMAND_ARGS)
|
||||
{
|
||||
struct utsname un;
|
||||
|
||||
if (uname(&un) == 0)
|
||||
to_user(from,"%s %s %s",un.sysname,un.release,un.machine);
|
||||
}
|
||||
|
||||
char vmpeak[32];
|
||||
char vmsize[32];
|
||||
char vmrss[32];
|
||||
char vmdata[32];
|
||||
char vmstk[32];
|
||||
char vmexe[32];
|
||||
char vmlib[32];
|
||||
|
||||
struct // statusvalues
|
||||
{
|
||||
const char *key;
|
||||
const int klen;
|
||||
char *valbuf;
|
||||
|
||||
} sv[] =
|
||||
{
|
||||
{ "VmPeak:", 7, vmpeak },
|
||||
{ "VmSize:", 7, vmsize },
|
||||
{ "VmRSS:", 6, vmrss },
|
||||
{ "VmData:", 7, vmdata },
|
||||
{ "VmStk:", 6, vmstk },
|
||||
{ "VmExe:", 6, vmexe },
|
||||
{ "VmLib:", 6, vmlib },
|
||||
{ NULL, 0, NULL }
|
||||
};
|
||||
|
||||
int parse_proc_status(char *line)
|
||||
{
|
||||
const char *key;
|
||||
char *dest,*limit;
|
||||
int i;
|
||||
|
||||
key = chop(&line);
|
||||
debug("pps key = %s (%s)\n",key,line);
|
||||
if (key == NULL)
|
||||
return(FALSE);
|
||||
for(i=0;sv[i].key;i++)
|
||||
{
|
||||
if (strncmp(key,sv[i].key,sv[i].klen) == 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
debug("(parse_proc_status) key %s -> %s\n",key,line);
|
||||
#endif /* DEBUG */
|
||||
dest = sv[i].valbuf;
|
||||
limit = sv[i].valbuf + 31;
|
||||
while(*line == ' ')
|
||||
line++;
|
||||
while(*line && dest <= limit)
|
||||
*(dest++) = *(line++);
|
||||
*dest = 0;
|
||||
}
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
void do_meminfo(COMMAND_ARGS)
|
||||
{
|
||||
char fn[64];
|
||||
pid_t p;
|
||||
int i,fd;
|
||||
|
||||
p = getpid();
|
||||
snprintf(fn,sizeof(fn),"/proc/%i/status",p);
|
||||
|
||||
for(i=0;sv[i].key;i++)
|
||||
*(sv[i].valbuf) = 0;
|
||||
if ((fd = open(fn,O_RDONLY)) < 0)
|
||||
return;
|
||||
readline(fd,&parse_proc_status); // readline closes fd
|
||||
|
||||
to_user(from,"VM %s (Max %s), RSS %s [ Code %s, Data %s, Libs %s, Stack %s ]",
|
||||
vmsize,vmpeak,vmrss,vmexe,vmdata,vmlib,vmstk);
|
||||
}
|
||||
|
||||
void do_cpuinfo(COMMAND_ARGS)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* HOSTINFO */
|
||||
5
src/ld/README
Normal file
5
src/ld/README
Normal file
@@ -0,0 +1,5 @@
|
||||
get the default script with:
|
||||
|
||||
gcc -o energymech mega.c -lcrypt -Wl,-verbose > default
|
||||
|
||||
edit out non-script output and modify with the custom .text.[abcde] entries
|
||||
236
src/ld/elf64-x86-64
Normal file
236
src/ld/elf64-x86-64
Normal file
@@ -0,0 +1,236 @@
|
||||
/* Script for -z combreloc: combine and sort reloc sections */
|
||||
/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
|
||||
Copying and distribution of this script, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. */
|
||||
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
|
||||
"elf64-x86-64")
|
||||
OUTPUT_ARCH(i386:x86-64)
|
||||
ENTRY(_start)
|
||||
SEARCH_DIR("/usr/x86_64-slackware-linux/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/x86_64-slackware-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.note.gnu.build-id : { *(.note.gnu.build-id) }
|
||||
.hash : { *(.hash) }
|
||||
.gnu.hash : { *(.gnu.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.gnu.version : { *(.gnu.version) }
|
||||
.gnu.version_d : { *(.gnu.version_d) }
|
||||
.gnu.version_r : { *(.gnu.version_r) }
|
||||
.rela.dyn :
|
||||
{
|
||||
*(.rela.init)
|
||||
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
|
||||
*(.rela.fini)
|
||||
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
|
||||
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
|
||||
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
|
||||
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
|
||||
*(.rela.ctors)
|
||||
*(.rela.dtors)
|
||||
*(.rela.got)
|
||||
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
|
||||
*(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
|
||||
*(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
|
||||
*(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
|
||||
*(.rela.ifunc)
|
||||
}
|
||||
.rela.plt :
|
||||
{
|
||||
*(.rela.plt)
|
||||
PROVIDE_HIDDEN (__rela_iplt_start = .);
|
||||
*(.rela.iplt)
|
||||
PROVIDE_HIDDEN (__rela_iplt_end = .);
|
||||
}
|
||||
.init :
|
||||
{
|
||||
KEEP (*(SORT_NONE(.init)))
|
||||
}
|
||||
.plt : { *(.plt) *(.iplt) }
|
||||
.plt.got : { *(.plt.got) }
|
||||
.plt.bnd : { *(.plt.bnd) }
|
||||
.text :
|
||||
{
|
||||
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
|
||||
*(.text.exit .text.exit.*)
|
||||
*(.text.startup .text.startup.*)
|
||||
*(.text.hot .text.hot.*)
|
||||
*(.text.e) /* RARE */
|
||||
*(.text.d) /* INIT */
|
||||
*(.text.b) /* CFG1 */
|
||||
*(.text.c) /* CMD1 */
|
||||
*(.text.a) /* CORE */
|
||||
*(.text.f) /* DBUG */
|
||||
*(.text .stub .text.* .gnu.linkonce.t.*)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
}
|
||||
.fini :
|
||||
{
|
||||
KEEP (*(SORT_NONE(.fini)))
|
||||
}
|
||||
PROVIDE (__etext = .);
|
||||
PROVIDE (_etext = .);
|
||||
PROVIDE (etext = .);
|
||||
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
.eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
|
||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
|
||||
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
|
||||
.gcc_except_table.*) }
|
||||
.gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
|
||||
/* These sections are generated by the Sun/Oracle C++ compiler. */
|
||||
.exception_ranges : ONLY_IF_RO { *(.exception_ranges
|
||||
.exception_ranges*) }
|
||||
/* Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up. */
|
||||
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
|
||||
/* Exception handling */
|
||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
|
||||
.gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
|
||||
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
|
||||
.exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
|
||||
/* Thread Local Storage sections */
|
||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
}
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array ))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array ))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
.ctors :
|
||||
{
|
||||
/* gcc uses crtbegin.o to find the start of
|
||||
the constructors, so we make sure it is
|
||||
first. Because this is a wildcard, it
|
||||
doesn't matter if the user does not
|
||||
actually link against crtbegin.o; the
|
||||
linker won't look for a file to match a
|
||||
wildcard. The wildcard also means that it
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*crtbegin?.o(.ctors))
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
}
|
||||
.dtors :
|
||||
{
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*crtbegin?.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
}
|
||||
.jcr : { KEEP (*(.jcr)) }
|
||||
.data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
.got : { *(.got) *(.igot) }
|
||||
. = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
|
||||
.got.plt : { *(.got.plt) *(.igot.plt) }
|
||||
.data :
|
||||
{
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
SORT(CONSTRUCTORS)
|
||||
}
|
||||
.data1 : { *(.data1) }
|
||||
_edata = .; PROVIDE (edata = .);
|
||||
. = .;
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.dynbss)
|
||||
*(.bss .bss.* .gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
/* Align here to ensure that the .bss section occupies space up to
|
||||
_end. Align after .bss to ensure correct alignment even if the
|
||||
.bss section disappears because there are no input sections.
|
||||
FIXME: Why do we need it? When there is no .bss section, we don't
|
||||
pad the .data section. */
|
||||
. = ALIGN(. != 0 ? 64 / 8 : 1);
|
||||
}
|
||||
.lbss :
|
||||
{
|
||||
*(.dynlbss)
|
||||
*(.lbss .lbss.* .gnu.linkonce.lb.*)
|
||||
*(LARGE_COMMON)
|
||||
}
|
||||
. = ALIGN(64 / 8);
|
||||
. = SEGMENT_START("ldata-segment", .);
|
||||
.lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
|
||||
{
|
||||
*(.lrodata .lrodata.* .gnu.linkonce.lr.*)
|
||||
}
|
||||
.ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
|
||||
{
|
||||
*(.ldata .ldata.* .gnu.linkonce.l.*)
|
||||
. = ALIGN(. != 0 ? 64 / 8 : 1);
|
||||
}
|
||||
. = ALIGN(64 / 8);
|
||||
_end = .; PROVIDE (end = .);
|
||||
. = DATA_SEGMENT_END (.);
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/* DWARF 3 */
|
||||
.debug_pubtypes 0 : { *(.debug_pubtypes) }
|
||||
.debug_ranges 0 : { *(.debug_ranges) }
|
||||
/* DWARF Extension. */
|
||||
.debug_macro 0 : { *(.debug_macro) }
|
||||
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
|
||||
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "function.c"
|
||||
#include "greet.c"
|
||||
#include "help.c"
|
||||
#include "hostinfo.c"
|
||||
#include "irc.c"
|
||||
#include "kicksay.c"
|
||||
#include "main.c"
|
||||
|
||||
@@ -449,9 +449,10 @@ recheck_alias:
|
||||
{
|
||||
if (!Strcasecmp(alias->alias,command))
|
||||
{
|
||||
afmt(amem,alias->format,msg);
|
||||
unchop(command,msg);
|
||||
afmt(amem,alias->format,command);
|
||||
#ifdef DEBUG
|
||||
debug("(on_msg) [ALIAS] %s %s --> %s\n",command,msg,amem);
|
||||
debug("(on_msg) [ALIAS] %s --> %s\n",command,amem);
|
||||
#endif /* DEBUG */
|
||||
msg = amem;
|
||||
pt = chop(&msg);
|
||||
|
||||
Reference in New Issue
Block a user